Hi,
When I try to convert png to non-Png(eg JPG), the image gets corrupted if its trasparent. So I need to handle this case in my magick++ c++ code.
I am basically trying to remove transparency.
The following command line works:
1.convert transparent.png -alpha remove transparent.jpg
2.convert transparent.png -border 0 -alpha off transparent.jpg.
How can achive the same thing in c++?
I tried
1. image.alpha(off) -NOT working
2. Image.matte(false) && image.border(0) - NOT working.
I am using ImageMagick 6.9.6
Help is very much appreciated.
Thanks
remove trasparency from PNG( remove alpha)
-
- Posts: 5
- Joined: 2018-06-28T15:02:22-07:00
- Authentication code: 1152
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: remove trasparency from PNG( remove alpha)
You would be best flattening the image against some background color when converting a transparent PNG to JPG.
Code: Select all
convert image.png -background white -flatten image.jpg
-
- Posts: 5
- Joined: 2018-06-28T15:02:22-07:00
- Authentication code: 1152
Re: remove trasparency from PNG( remove alpha)
How do I do this in c++(magick++) flattening is working on commandline but not through c++ code
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: remove trasparency from PNG( remove alpha)
Sorry I do not use C++. So one of the other users or developers will need to help you.