I want to create a 16bit image with a single color. I've been using -fill and -draw to do this but I can't seem to get the exact 16bit color I want. Does -fill only take in 8 bit values? It seems that if you use -fill on a 16bit image, it will scale it to something close to the 16 bit value but I can't get the exact values I need.
~Drew
-fill option and 16bit data
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: -fill option and 16bit data
I'm using the 8-bit version of IM, but if I do:
the pixels are all the correct colour.
However, if I do this:
the pixels are actually rgb(120,179,50)
So, if you're saving the image as a jpg, try it as png instead.
Pete
Code: Select all
convert -size 640x480 xc:rgb(120,180,50) test.png
However, if I do this:
Code: Select all
convert -size 640x480 xc:rgb(120,180,50) test.jpg
So, if you're saving the image as a jpg, try it as png instead.
Pete
Re: -fill option and 16bit data
I think something similar to this came up before and it was blamed on jpg compression?
The conclusion was as Pete sugested save as a png instead.
The conclusion was as Pete sugested save as a png instead.
Re: -fill option and 16bit data
If I run this...
convert blue.tif -fill rgb(1,2,300) -draw "rectangle 0,0 1920,1080" newblue.tif
blue.tif is a 16bit color image. newblue ends up as a solid color of RGB: 257, 514, 65535
what I really want to do is this:
convert blue.tif -fill rgb(13050, 50000, 33333) -draw "rectangle 0,0 1920,1080" newblue.tif
but newblue ends up as a solid color of RGB: 65535, 65535, 65535
convert blue.tif -fill rgb(1,2,300) -draw "rectangle 0,0 1920,1080" newblue.tif
blue.tif is a 16bit color image. newblue ends up as a solid color of RGB: 257, 514, 65535
what I really want to do is this:
convert blue.tif -fill rgb(13050, 50000, 33333) -draw "rectangle 0,0 1920,1080" newblue.tif
but newblue ends up as a solid color of RGB: 65535, 65535, 65535
Re: -fill option and 16bit data
Read http://www.imagemagick.org/script/color.php. If you want to use rgb() you need to specify percentages to generate 16-bit values. You can also use hex color numbers, for example, #123412341234.
Re: -fill option and 16bit data
Thank you for your help! Thats exactly what I was missing.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: -fill option and 16bit data
Additional note. The percentages are floating point values, so you can add some decimal places to get exactly the color wanted.
Also be sure to add -depth 16 even on a IM Q16 version, as this ensures that the output will be an 16 bit image, and not re-saved as 8-bit if the source image was 8 bit (like an 8bit color canvas)
Also be sure to add -depth 16 even on a IM Q16 version, as this ensures that the output will be an 16 bit image, and not re-saved as 8-bit if the source image was 8 bit (like an 8bit color canvas)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/