Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Non-photorealistic rendering projects
- -AI-
- New to Scratch
9 posts
Non-photorealistic rendering projects
Can someone help me fix the (hopefully) very obvious bug in my code that I missed?
Right now, the problem is with the compression and decompression of the variables (I think).
The project is here.
Right now, the problem is with the compression and decompression of the variables (I think).
The project is here.
Possibly the most silent reader on the forums.
- MartinBraendli2
- Scratcher
100+ posts
Non-photorealistic rendering projects
Can someone help me fix the (hopefully) very obvious bug in my code that I missed?
Right now, the problem is with the compression and decompression of the variables (I think).
The project is here.
Rule of thumb: Don't use any base, that isn't base-2^n. Dont! The conversion will be slow (and you might make mistakes). If you use other bases, use eigher:
- Base64. I used it here, have a look at the Sprites “I/O” and “base64”
- Base16/Hexadecimal. I use it all the time. There are ways to get more information into a single character (Base64 gets 50% more), but its super simple and fast to convert, especially since Scratch can easily convert from Hex to decimal.
set [ encoded v] to [2AFF3D]Also, hexadecimal can be used in cloud variables. So unless you have a really good reason, don't use other bases.
set [dec v] to ((1) * (join [0x] [(encoded)]))
To get a hex string from an image go to https://tegmen.github.io/imgToHex/ (doesn't work well with chrome, use for example Firefox).
To get a list with colors:
set [i v] to [1]
repeat ((width) * (height))
add (join (join (join (join (join [0x] (letter (i) of (encoded))(letter ((i) + (1)) of (encoded))) (letter ((i) + (2)) of (encoded))) (letter ((i) + (3)) of (encoded))) (letter ((i) + (4)) of (encoded))) (letter ((i) + (5)) of (encoded))) to [image v]
change [i v] by (6)
end
- awesome-llama
- Scratcher
1000+ posts
Non-photorealistic rendering projects
https://scratch.mit.edu/projects/163744280/My llama looks weird Output from the latest project in the studio:
Cool!
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
- -AI-
- New to Scratch
9 posts
Non-photorealistic rendering projects
Dont! The conversion will be slow (and you might make mistakes). If you use other bases, use eigher:Hmm… makes sense… Rule of thumb: Don't use any base, that isn't base-2^n.
- Base64. I used it here, have a look at the Sprites “I/O” and “base64”
- Base16/Hexadecimal. I use it all the time. There are ways to get more information into a single character (Base64 gets 50% more), but its super simple and fast to convert, especially since Scratch can easily convert from Hex to decimal.set [ encoded v] to [2AFF3D]
set [dec v] to ((1) * (join [0x] [(encoded)]))
Does scratch have a built in for dec to hex the way you show it has hex to dec?
Would make encoding easier.
Possibly the most silent reader on the forums.
- -AI-
- New to Scratch
9 posts
Non-photorealistic rendering projects
Oh. Actually base 16 doesn't compress the data enough, and Scratch won't save.
Possibly the most silent reader on the forums.
- Rumanti
- Scratcher
1000+ posts
Non-photorealistic rendering projects
Here's my go at it:
-snip-
Whoa, that's really interesting! I've never seen anything like this before.
Is there a particular name/algorithm for this kind of NPR?
:wq
- Layzej
- Scratcher
100+ posts
Non-photorealistic rendering projects
Here's my go at it:
-snip-
Whoa, that's really interesting! I've never seen anything like this before.
Is there a particular name/algorithm for this kind of NPR?
It's in the style of petros vrellis “a new way to knit” - http://artof01.com/vrellis/works/knit.html
- Layzej
- Scratcher
100+ posts
Non-photorealistic rendering projects
Did you write an new script to show you a step by step instruction? How long did it take you?
I just added a line to the existing project to save each step to a list. I had to re-calibrate though because the thread in the original project is much lighter than real black thread. I got about 1500 stitches in before I realized, re-calibrated, and started over. The final project is only 900 stitches (though I may add 100 more to give more definition to the nose). The whole project took about a week to complete.
- gtoal
- Scratcher
1000+ posts
Non-photorealistic rendering projects
I love when this stuff crosses over into the real world!
The ultimate validation of course is if you can sell it… Etsy, anyone? :-)
Also it would make a good Instructable, if you use that site. (Write it up and have it ready to release next time they have an appropriate competition…)
G
The ultimate validation of course is if you can sell it… Etsy, anyone? :-)
Also it would make a good Instructable, if you use that site. (Write it up and have it ready to release next time they have an appropriate competition…)
G
- NitroCipher
- Scratcher
500+ posts
Non-photorealistic rendering projects
Is there a starter project that has the NPR guy as a long list of hex numbers? (row by row, top to bottom)
when flag clicked //hopefully run like this
set [i v] to [0]
pen up
clear
set y to (180)
repeat (360)
set x to (-240)
pen down
repeat (480)
change [i v] by (1)
set pen color to ((join[0](item (i) of [image v]))*(1))
change x by (1)
end
change y by (-1)
Last edited by NitroCipher (Nov. 28, 2017 20:57:06)
I hope my post helped you in some way! Post count: 500+
Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
- Layzej
- Scratcher
100+ posts
Non-photorealistic rendering projects
Is there a starter project that has the NPR guy as a long list of hex numbers? (row by row, top to bottom)
Maybe this one by Chooper: https://scratch.mit.edu/projects/77685662
- Layzej
- Scratcher
100+ posts
Non-photorealistic rendering projects
here has now been taken completely online.What I do have to say though is that the tool to scan custom images I mentioned
Yep, that's right. It even has a few more options, such as being able to resize the image.
You can access the tool at <broken link>.
Does anyone know of an online pic->list converter? The Chooper one is no more
- Layzej
- Scratcher
100+ posts
Non-photorealistic rendering projects
Here's a non-photorealistic rendering of a 3d model of the NPR guy:
I
I
- Layzej
- Scratcher
100+ posts
Non-photorealistic rendering projects
I tried posting the stf file here, but…
“Ensure this value has at most 200000 characters (it has 942005).”
“Ensure this value has at most 200000 characters (it has 942005).”
- Rhodare
- Scratcher
100+ posts
Non-photorealistic rendering projects
I can’t believe this thread is still going XD
- Discussion Forums
- » Advanced Topics
- » Non-photorealistic rendering projects