not sure about this question

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: not sure about this question

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: not sure about this question

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply