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?".
laeatwork
Posts: 3 Joined: 2012-05-09T05:28:40-07:00
Authentication code: 13
Post
by laeatwork » 2012-06-27T13:55:20-07:00
Hi,
I struggling to create new icons with the following format
Code: Select all
Type: PaletteMatte
Endianess: Undefined
Colorspace: RGB
Depth: 24/8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
I have tried MANY different convert argument butt still no success.
All tries ends up in one of the following, which is not accepted in the VB6 environment where I need to patch.
or
Any ideas are appreciated.
/Lars
glennrp
Posts: 1147 Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W
Post
by glennrp » 2012-06-27T15:56:21-07:00
You need to remove the alpha channel. In older versions of ImageMagick the
option was "+matte" but I think you can now use "-alpha off" or "-alpha remove".
If you want to keep the alpha channel but reduce it to 1-bit, you can use
the PNG8 format (convert file.png png8:reduced.png).
glenn.rp> convert logo: -transparent white png8:logot.png
glenn.rp> identify -verbose logot.png
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
The "Depth: 8-bit" is not what's actually in the file. The
individual Channel depths are correct.
laeatwork
Posts: 3 Joined: 2012-05-09T05:28:40-07:00
Authentication code: 13
Post
by laeatwork » 2012-06-27T22:00:45-07:00
Thanks for the reply. I thing I have control over the Alpha channel.
It is the Depth settings that fools me.
If I do as follows:
Use image magic to convert a PNG to an IOC file.
This ICO file is not accepted by VisualBasic 6 as an ico file.
Open the ICO file using iconfx utility
Set the file "File data type" to TrueColor (24 bits)
Then the ICO file i accepted by VB6
If I dump the two ICO files using identify -verbose the difference looks like follows:
Code: Select all
--- im.txt 2012-06-28 06:39:56.755668800 +0200
+++ fx.txt 2012-06-27 22:25:29.701739500 +0200
@@ -8,7 +8,7 @@
Type: PaletteMatte
Endianess: Undefined
Colorspace: RGB
- Depth: 32/8-bit
+ Depth: 24/8-bit
Channel depth:
red: 8-bit
green: 8-bit
@@ -185,14 +185,14 @@
Orientation: Undefined
Properties:
date:create: 2012-06-27T22:04:26+02:00
- date:modify: 2012-06-28T06:39:56+02:00
- signature: 10cc0817061ac04af42fdc1aa024cc231542c345e2c92adfc35c8a0a91396e10
+ date:modify: 2012-06-27T22:21:42+02:00
+ signature: a939711538ded9c9a5738d4cd655d9e2613d3c9136248359c3cf667f5f7f2d16
Artifacts:
verbose: true
Tainted: False
- Filesize: 4.29KB
+ Filesize: 3.26KB
Number pixels: 1.02K
- Pixels per second: 1.025MB
+ Pixels per second: 1.023MB
User time: 0.000u
- Elapsed time: 0:01.000
+ Elapsed time: 0:01.001
Version: ImageMagick 6.7.5-4 2012-02-06 Q16 http://www.imagemagick.org
As you can see the only significant change is the depth settings. IM uses 'Depth: 32/8-bit' and ICON FIX 'Depth: 24/8-bit'
How do I tell IM to set Depth: 24/8-bit ?
/Lars
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2012-06-28T20:09:27-07:00
24 bit is 8 bits RGB but no alpha channel.
So don't save a alpha channel.
Use -alpha off before the save. Or use png24: