{"action":"created","issue":{"url":"https://api.github.com/repos/haraldk/TwelveMonkeys/issues/238","repository_url":"https://api.github.com/repos/haraldk/TwelveMonkeys","labels_url":"https://api.github.com/repos/haraldk/TwelveMonkeys/issues/238/labels{/name}","comments_url":"https://api.github.com/repos/haraldk/TwelveMonkeys/issues/238/comments","events_url":"https://api.github.com/repos/haraldk/TwelveMonkeys/issues/238/events","html_url":"https://github.com/haraldk/TwelveMonkeys/issues/238","id":153494753,"number":238,"title":"Convert complex PSD to JPG rendering issue","user":{"login":"scottialex","id":6372395,"avatar_url":"https://avatars.githubusercontent.com/u/6372395?v=3","gravatar_id":"","url":"https://api.github.com/users/scottialex","html_url":"https://github.com/scottialex","followers_url":"https://api.github.com/users/scottialex/followers","following_url":"https://api.github.com/users/scottialex/following{/other_user}","gists_url":"https://api.github.com/users/scottialex/gists{/gist_id}","starred_url":"https://api.github.com/users/scottialex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottialex/subscriptions","organizations_url":"https://api.github.com/users/scottialex/orgs","repos_url":"https://api.github.com/users/scottialex/repos","events_url":"https://api.github.com/users/scottialex/events{/privacy}","received_events_url":"https://api.github.com/users/scottialex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-06T17:01:34Z","updated_at":"2016-05-06T17:28:42Z","closed_at":null,"body":"Harald, first off great job! Thank you :-)\r\n\r\nI am able to read a simple PSD file and write it to JPG but when the PSD is complex I get weird image rendering. I have attached the image of the PSD file with the Layer palette structure and the JPG version with rendering issues.\r\n\r\nMy code:\r\n(removed image path for simplicity)\r\n\r\nFile file = new File( \"final_logo_sm.psd\" );\r\nBufferedImage image = ImageIO.read( file );\r\nImageIO.write(image, \"jpg\", new File(\"final_logo_sm.jpg\"));\r\n\r\nHere's a link to download the sample PSD file for local testing:\r\nhttps://drive.google.com/file/d/0B8rwnalEoCXnelJsUmllMXlZUmc/view?usp=sharing\r\n\r\nGoogle drive in Chrome converts this exact PSD to a PNG blob into an HTML image object for previewing without issues and it does it very quickly. We are looking to accomplish the exact same result; that is: convert PSD to JPG/PNG --> Save to DB --> reuse it for client-side preview.\r\n\r\nThank you very much for all your help!\r\n\r\n![final_logo_sm](https://cloud.githubusercontent.com/assets/6372395/15079941/7c577f14-1389-11e6-9df7-a988cffa8191.jpg)\r\n\r\n![screen shot 2016-05-06 at 12 49 20 pm](https://cloud.githubusercontent.com/assets/6372395/15079886/2734a836-1389-11e6-8872-1e9deb1409b8.png)"},"comment":{"url":"https://api.github.com/repos/haraldk/TwelveMonkeys/issues/comments/217507246","html_url":"https://github.com/haraldk/TwelveMonkeys/issues/238#issuecomment-217507246","issue_url":"https://api.github.com/repos/haraldk/TwelveMonkeys/issues/238","id":217507246,"user":{"login":"haraldk","id":110299,"avatar_url":"https://avatars.githubusercontent.com/u/110299?v=3","gravatar_id":"","url":"https://api.github.com/users/haraldk","html_url":"https://github.com/haraldk","followers_url":"https://api.github.com/users/haraldk/followers","following_url":"https://api.github.com/users/haraldk/following{/other_user}","gists_url":"https://api.github.com/users/haraldk/gists{/gist_id}","starred_url":"https://api.github.com/users/haraldk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haraldk/subscriptions","organizations_url":"https://api.github.com/users/haraldk/orgs","repos_url":"https://api.github.com/users/haraldk/repos","events_url":"https://api.github.com/users/haraldk/events{/privacy}","received_events_url":"https://api.github.com/users/haraldk/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T17:28:42Z","updated_at":"2016-05-06T17:28:42Z","body":"Hi Alejandro,\r\n\r\nThanks! \r\n\r\nLooking at your JPEG output, my first reaction is that this is likely a JPEG writing issue, rather than a PSD reading issue, because a lot of JPEG software does not fully support 4 channel RGBA JPEG data (it's often misinterpreted as CMYK or PhotoYCCA, which is why you get completely weird colors). I also suspect the default Java `JPEGImageWriter` not adhering to the conventions for writing RGBA data...\r\n\r\nAnyway, can you try writing the result as PNG rather than JPEG, and attach the output of that conversion? Does it look the same, or is it okay?\r\n\r\nIf it looks the same, I'll look into it as soon as possible! But I won't be able to do that before monday I'm afraid.\r\n\r\n\r\nBest regards,\r\n\r\n-- \r\nHarald K\r\n\r\n"}}