Hi guys, I'm pretty sure this is a bug since I've been using imagemagick to convert a few hundred files with some bash scripts for the last hour or so with no problem (and utilising the same command)).
The command that I use hasn't changed from my previous working command and is basically:
convert rauch0000.bmp -transparent "rgb(128,128,128)" 1.png
(I had it in a loop but tried this upon finding the error in order to confirm I hadn't made a mistake)
now gimp tells me the background of the picture rauch0000.bmp is 128,128,128 (or #808080) so this is what I use in the command. the files I am using is available here (the "rauch" {smoke} files are the ones causing trouble):
http://www.reinerstilesets.de/2d-grafiken/2d-animated/
under geschütz (the cannon) at the bottom, direct link here:
http://www.reinerstilesets.de/zips2d/Bgesch.zip
one of the worrying things that I found is that in addition to not setting the background to transparent as required (for the smoke {rauch} files only, curiously the rest of the files in the zip work, including the other ones with a 128,128,128 RGB background) the colour of the background gets changed.
anyone know what's going wrong here?
oh yeah, almost forgot:
$ convert -version
Version: ImageMagick 6.8.0-2 2012-12-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenCL
Error with convert and -transparent option
-
- Posts: 4
- Joined: 2013-01-04T07:34:22-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Error with convert and -transparent option
It works fine for me on IM 6.8.1.8 Q16 Mac OSX Snow Leopard:
convert rauch0000.bmp -transparent "rgb(128,128,128)" 1tmp1.png
1tmp1.png is has a transparent background.
convert rauch0000.bmp -transparent "rgb(128,128,128)" 1tmp1.png
1tmp1.png is has a transparent background.
-
- Posts: 4
- Joined: 2013-01-04T07:34:22-07:00
- Authentication code: 6789
Re: Error with convert and -transparent option
hmmm, double checked this by redownloading (incase I somehow had a corrupted file) and retesting this, still doesn't work for me:
convert rauch0000.bmp -transparent "rgb(128,128,128)" 1tmp1.png
1tmp1.png has a background of RGB 55,55,55 however for the explosions "explo0000.bmp" the background IS transparent.
(if you want to convert all of them at once I wrote a small bash script:
for f in *\ *.bmp; do mv "$f" "${f// /_}"; done
mkdir drawable-xhdpi
mkdir drawable
find * -prune -name '*.bmp' \
-exec convert '{}' -transparent "rgb(128,128,128)" drawable-xhdpi/'{}'.png \;
for f in drawable-xhdpi/*.png; do mv "$f" "${f//.bmp/}"; done
)
running ImageMagick 6.8.0-2 2012-12-17 Q16 on mac osx Mountain lion 10.8.2 can anyone else replicate the error? or the correct result like fmw42?
anyone have any ideas?
convert rauch0000.bmp -transparent "rgb(128,128,128)" 1tmp1.png
1tmp1.png has a background of RGB 55,55,55 however for the explosions "explo0000.bmp" the background IS transparent.
(if you want to convert all of them at once I wrote a small bash script:
for f in *\ *.bmp; do mv "$f" "${f// /_}"; done
mkdir drawable-xhdpi
mkdir drawable
find * -prune -name '*.bmp' \
-exec convert '{}' -transparent "rgb(128,128,128)" drawable-xhdpi/'{}'.png \;
for f in drawable-xhdpi/*.png; do mv "$f" "${f//.bmp/}"; done
)
running ImageMagick 6.8.0-2 2012-12-17 Q16 on mac osx Mountain lion 10.8.2 can anyone else replicate the error? or the correct result like fmw42?
anyone have any ideas?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Error with convert and -transparent option
I get your same bad results using IM 6.8.0.2 Q16 Mac OSX Snow Leopard. So it would appear to be a bug in that version of IM. You should consider upgrading your version of IM. There have been a lot of PNG bugs fixed. See http://www.imagemagick.org/script/changelog.php
Note it is transparent in 6.8.0.3. But I would suggest you upgrade as current as you can.
Note it is transparent in 6.8.0.3. But I would suggest you upgrade as current as you can.
-
- Posts: 4
- Joined: 2013-01-04T07:34:22-07:00
- Authentication code: 6789
Re: Error with convert and -transparent option
thanks fmw42 will upgrade now.
-
- Posts: 4
- Joined: 2013-01-04T07:34:22-07:00
- Authentication code: 6789
Re: Error with convert and -transparent option
in case anyones wondering, the bug also appears to be on ImageMagick 6.8.0-7 too (latest version on macports)
I guess I'd better install from source...
I guess I'd better install from source...
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Error with convert and -transparent option
I wrote this tutorial in response to a similar question. I install my delegates with MacPorts, but install IM manually so as to keep up with the IM versions.crashandburn4 wrote:in case anyones wondering, the bug also appears to be on ImageMagick 6.8.0-7 too (latest version on macports)
I guess I'd better install from source...
viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202