I've written a program generates an image based on my users' input, composites their input over top with a slight opacity, and outputs its as a jpeg. Most of the time, this works no problem (99% of my users upload jpegs or pngs)
The problem is that I have a user on my website that is trying to create an image from a gif (a gif with a transparent color, to be specific.) For whatever reason, when my program blended their image over top, it didn't pay heed to the opacity setting. It simply kept the transparent color of the gif and made everything else opaque. How do I fix this?
Code: Select all
if (_original_opacity != 0) { //original opacity is set to 10
_source_img->modifyImage();
_source_img->opacity(int(TransparentOpacity * float(100 - _original_opacity) / 100.));
_source_img->zoom(Geometry(out.columns(), out.rows()));
out.composite(*_source_img, 0, 0, DissolveCompositeOp);
}
input: http://mozaiq.org/mozaiq/0/102.8724744.source.gif
erroneous output: http://mozaiq.org/mozaiq/0/102.8724744.9.jpg