My current set up is taking a user uploaded file and converting it to mpc. This mpc is then what is loaded in the future. If the initial file was png then my code works. The code is a multiple layer simultaneous merge/multiply that does use the alpha/opacity channels. The code uses the pixel cache and reads/writes to that and synch's it back later. This code definitely works for png files and mpc files that were originally png. Though not for jpg files or mpc files that were originally jpg.
That said the problem is that when the initial file is a jpg I do not get the results I would expect, instead I get the same image but with inverted colors. If in my code I write the Image to a random png file before sending it into the multiplication code then it works as normal. This makes me assume that something happens to the Image class when it gets written. I am basically trying to do the same thing but without having to write something to the disk or memory. I tried doing
Code: Select all
images[x].image.magick("png");
images[x].image.matte(true);
images[x].image.opacity(0);
//images[x].image.write("temp.png");
This is what it should look like and does look like if I uncomment the write call above:
http://skreened.com/render-product/y/a/ ... h440z1.jpg
This is an example of the problem:
http://render.skreened.com/render-produ ... h440z1.jpg
As you can see its the same thing but the colors are inverted for some reason. What could that write call be doing to the Image class that wouldn't be done by the other code I have there?