I typically keep images of maps and things as tifs with 8-bit color, with an optimized palette.
I do this through corel photo paint.
Many times, I want to resize a map or photo by 50%. I am using convert.exe so I tried:
convert USGS.tif -resize 50%% -compress rle USGSsmaller.tif
The %% is because I am running from a windows batch file, it works fine with other operations.
The result of the resize is the colorspace gets set to 48 bit, and the image is huge. So I tried:
convert USGS.tif -resize 50%% -colors 256 -compress rle USGSsmall.tif
with very bad results, mostly blue pixels, ugly.
Is there something I need to do to resize, while keeping the palette intact, or some other way to end up with 8bit optimized palette?
I don't mind if it makes the 48bit , then converts to 8 bit, I just dont know how to do it. -colors 256 is not doing it.
thanks
How to preserve color palette when resizing
How to preserve color palette when resizing
James Maeding
Civil Engineer / Programmer
Civil Engineer / Programmer
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
I tried that just now, did not work. The size action worked fine but I got a 24 bit rgb image instead of 8 bit.
Any reason why I should be using the Q16 as opposed to Q8? I just chose the one that looked the most powerful. Maybe its not suited to people that only work with 24bit and lower colors.
thanks
Any reason why I should be using the Q16 as opposed to Q8? I just chose the one that looked the most powerful. Maybe its not suited to people that only work with 24bit and lower colors.
thanks
James Maeding
Civil Engineer / Programmer
Civil Engineer / Programmer
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Use -scale or -filter point to stop the resize creating new colors.
Results are however not as good.
Results are however not as good.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
I tried that and many other combinations, I get 24 bit every time.
I even uninstalled Q16 and put on Q8 version, same results.
One clue is if I just run a:
convert USGS.tif -depth 8 USGS8.tif
It errors out. It says a bunch of lines like "unexpected field...".
The sizing works fine, its the palette stuff that is failing.
I can post a portion of the image if there is a convenient place so you can see.
I am amazed I am hitting these issues with the first image I try.
Many other things work super well with IM, you would think the resample would be cake
I even uninstalled Q16 and put on Q8 version, same results.
One clue is if I just run a:
convert USGS.tif -depth 8 USGS8.tif
It errors out. It says a bunch of lines like "unexpected field...".
The sizing works fine, its the palette stuff that is failing.
I can post a portion of the image if there is a convenient place so you can see.
I am amazed I am hitting these issues with the first image I try.
Many other things work super well with IM, you would think the resample would be cake
James Maeding
Civil Engineer / Programmer
Civil Engineer / Programmer