8bit per channel to 6bpc (RGB)

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
Scorp1us
Posts: 4
Joined: 2010-06-23T13:37:41-07:00
Authentication code: 8675308

8bit per channel to 6bpc (RGB)

Post by Scorp1us »

I need to convert some images to 6bpc, which is to say that I want to zero the last 2 bits of each each RGB channel for preview on a reduced color display.

How can I do this with imagemagick?

Many thanks!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: 8bit per channel to 6bpc (RGB)

Post by anthony »

Level white to a value of 2^6-1 then +level back again. That should do the job.

convert image.png -level 0,63 +level 0,63 result.png

See 'Quantum Rounding' which is typically something to avoid, but in your case you want to do.
http://www.imagemagick.org/Usage/basics ... um_effects
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply