Hello,
I want to create a multicolored image as http://www.imagemagick.org/Usage/canvas ... lormap.jpg
I tried many commands, but not successfully
My goal is to have maximum of uniques colors in the smallest possible definition.
For example, i would have a 300x300 images with 90000 colors.
It's for a PNG filtering demonstration.
Thanks in advance !
Create a MultiColor Image
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Create a MultiColor Image
There are actually many ways to do this, some slow, some not so slow.
Most are listed in the Gradient Canvas area of IM examples, including the sparse color methods suggested.
http://www.imagemagick.org/Usage/canvas/#gradient
Another technique (very slow) is the use of FX to interpolate a small image, and is show in
http://www.imagemagick.org/Usage/misc/#interpolate
A variation on this (not shown on the page) is to use a two point affine distortion (distorting using the middle of pixels
That is equivalent to the FX method and is faster but as you can see needs some setup.
Most are listed in the Gradient Canvas area of IM examples, including the sparse color methods suggested.
http://www.imagemagick.org/Usage/canvas/#gradient
Another technique (very slow) is the use of FX to interpolate a small image, and is show in
http://www.imagemagick.org/Usage/misc/#interpolate
A variation on this (not shown on the page) is to use a two point affine distortion (distorting using the middle of pixels
Code: Select all
convert \( xc:red xc:blue +append \) \
\( xc:yellow xc:cyan +append \) -append \
-filter point -interpolate bilinear -define distort:viewport=100x100 \
-distort Affine '.5,.5 .5,.5 1.5,1.5 99.5,99.5' interpolate_bilinear.jpg
That is equivalent to the FX method and is faster but as you can see needs some setup.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Create a MultiColor Image
I've already tested that before posting. The proposed codes do not work for me, syntax seems to be incorrect. I'm running under Windows, with the lastest version.
Maybe i do not know how to use it. I'm a IM noob user, but if i copy your codes to a batch file, it just does not work.
For example :
To run that, I've to modify it to :
This is the only manipulation i've successfully done ! I tried to modify others, but it failed.
Thanks in advance.
Maybe i do not know how to use it. I'm a IM noob user, but if i copy your codes to a batch file, it just does not work.
For example :
Code: Select all
convert -size 30x600 xc:'#0F0' -colorspace HSB \
gradient: -compose CopyRed -composite \
-colorspace RGB -rotate 90 gradient_rainbow.jpg
Code: Select all
convert -size 30x600 xc:#0F0 -colorspace HSB gradient: -compose CopyRed -composite -colorspace RGB -rotate 90 gradient_rainbow.jpg
Thanks in advance.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Create a MultiColor Image
For conversion of UNIX type commands to DOS see...
http://www.imagemagick.org/Usage/windows/#dos
http://www.imagemagick.org/Usage/windows/#dos
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Create a MultiColor Image
See the link Anthony posted. But 3 issues are common
1) line continuations in Windows is ^ and not \
2) replace single quotes with double quotes
3) do not escape parens with \, no escape is needed
1) line continuations in Windows is ^ and not \
2) replace single quotes with double quotes
3) do not escape parens with \, no escape is needed
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Create a MultiColor Image
This discussion was continued but for a completely different topic or point.
All the posts involved has been split into a new topic in "Digital Image Processing"
with a topic name of "Resize using center of pixel (not edge)"
viewtopic.php?f=22&t=18846
All the posts involved has been split into a new topic in "Digital Image Processing"
with a topic name of "Resize using center of pixel (not edge)"
viewtopic.php?f=22&t=18846
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/