IM lowers color depth when I don't want it to

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
posfan12
Posts: 7
Joined: 2012-05-09T18:19:13-07:00
Authentication code: 13

IM lowers color depth when I don't want it to

Post by posfan12 »

I am using the following command on a 24bit input file:

Code: Select all

convert "%ImgPath%\Walls_Misc00.png" -crop 64x96+0+32! "%ImgPath%\Walls_Misc00_crop.png"
However, the result is an 8bit image. How do I make it so that the image stays 24bit? Thanks!

Version: ImageMagick 6.9.2-6 Q16 x64 2015-11-14 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangoca
iro png ps rsvg tiff webp xml zlib
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: IM lowers color depth when I don't want it to

Post by snibgo »

Prefix the output filename with PNG24: like this:

Code: Select all

convert "%ImgPath%\Walls_Misc00.png" -crop 64x96+0+32! "PNG24:%ImgPath%\Walls_Misc00_crop.png"
snibgo's IM pages: im.snibgo.com
posfan12
Posts: 7
Joined: 2012-05-09T18:19:13-07:00
Authentication code: 13

Re: IM lowers color depth when I don't want it to

Post by posfan12 »

That worked, thanks.
Post Reply