Image size

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Image size

F. Medeiros
Hello again,

Sorry to bother, I have been interested in shoebot for quite some time
but now I have finally a project where I can use it. I am still very
noob, please tell me if this is not the place for these questions.

The following code gives me an image that is 125x125 pixels. Shouldn't
it be 100x100?

size(100,100)
colorrange(255)
colormode(HSB)

stp = 10

for y in range(0, HEIGHT/stp, 1):
     for x in range(0, WIDTH/stp, 1):
        fill(240, random(130, 255), random(0, 162))
        rect(x*stp, y*stp, stp, stp)

Thank you.

F.  Medeiros.

_______________________________________________
Shoebot-devel mailing list
[hidden email]
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net

rand-pix_7.svg (20K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Image size

Stuart Axon
Interesting !

SVG is Vector based, I'm not 100% sure what happens wrt the scaling, but it could be this:
 
 
Of course, because SVG is Vector based you can scale it how you want afterwards, losslessly.


If you output to PNG, a raster format then the image is 100x100, exactly as you would expect.

S++


On Wednesday, July 9, 2014 10:49 AM, F. Medeiros <[hidden email]> wrote:


Hello again,

Sorry to bother, I have been interested in shoebot for quite some time
but now I have finally a project where I can use it. I am still very
noob, please tell me if this is not the place for these questions.

The following code gives me an image that is 125x125 pixels. Shouldn't
it be 100x100?

size(100,100)
colorrange(255)
colormode(HSB)

stp = 10

for y in range(0, HEIGHT/stp, 1):
    for x in range(0, WIDTH/stp, 1):
        fill(240, random(130, 255), random(0, 162))
        rect(x*stp, y*stp, stp, stp)

Thank you.

F.  Medeiros.

_______________________________________________
Shoebot-devel mailing list
[hidden email]
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net



_______________________________________________
Shoebot-devel mailing list
[hidden email]
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net