FreeImage: paste with transparency problem

BlitzMax Forums/Brucey's Modules/FreeImage: paste with transparency problem

ima747(Posted 2012) [#1]
Im trying to do the following:
Load a JPEG main image
Load a transparent PNG "icon" graphic
Paste the "icon" into the JPEG

The problem:
Paste only seems to work if both sources are transparent or both are solid.

Result:
If I paste a transparent icon into a JPEG nothing happens. If I post the same icon into another transparent PNG it pastes but doesn't respect the transparency (I get solid background color). If I paste a JPEG onto a JPEG it works fine.

I've tried converting the bits of the main image in the hopes that would help but that raises other problems for me elsewhere and doesn't seem to work.


skn3(Posted 2012) [#2]
Try setting the alpha value to 256? (> 255)


ima747(Posted 2012) [#3]
Thanks but did that. It has to do with the image data itself, alpha values work perfects if you're using a JPEG, but of course JPEG doesn't support transparency etc. It just won't draw stuff with alpha in it. I've tried using masking and a bunch of other hacks but it doesn't work.


skn3(Posted 2012) [#4]
Weird, well in theory if your converting both images to use the same bit layout/depth then it should work. Have you tried doing this for both images?

Apart from that I dunno if I can offer anymore help, seems weird! Maybe post some test code with images and I could have a play? I have been doing a ton of feeeimage stuff lately so might be able to figure it out...

Last edited 2012


ima747(Posted 2012) [#5]
yes, I've tried converting them to match, and converting both to a middle standard with no luck. It smacks of an internal bug in freeimage to me. I've moved past it in my project and just adapted by graphics for the time being but if I get time I'll try to pull out a sample.