Page 1 of 1

Re: not sure about this question

Posted: 2008-08-19T14:56:55-07:00
by fmw42
Are you asking if you can expand 1 pixel from an image to make a new larger image from that pixel?

convert yourimage[1x1+xoffset+yoffset] -scale 100x100! newimage

or

conver yourimage -crop 1x1+xoffset+yoffset -scale 100x100! +repage newimage

Either will take 1 pixel at xoffset and yoffset from the top left and exand it to a new 100x100 image, all with the same color as the original image's single pixel that was selected


see http://www.imagemagick.org/script/comma ... ptions.php
and http://www.imagemagick.org/Usage/

as good reference pages

Re: not sure about this question

Posted: 2008-08-19T21:02:20-07:00
by anthony
you can also do color maths like averaging two colors.

Code: Select all

convert xc:  rose:  -fx '(v.p{40,30}+v.p{11,15})/2'  -scale 150x100\!  avg_color.png
The above takes two colors from the second image and saves it into the single pixel first image. That image (the second is deleted automatically), is then scaled to the size wanted (ignoring aspect ratio).

Warning: if semi-transparency is involved the above averaging formular becomes a lot more complex as the colors also needs to be weighted by the amout of 'alpha' transparency is present in each color! The alpha value however remains a normal average.