JPEXS Free Flash Decompiler Issue Tracker

If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler

NEW : We have got a new blog where we post some interesting SWF internals info.

Error: Please login first to download files from the Issue Tracker. You can register for free.
List of issuesList of issues

#2454 Color difference between SVG import and PNG import for bitmaps
Author:
Date created:
Type: bug
Visibility: Everybody
Assigned to:
Labels: ExportSVG
State: closed Help

I'm exporting a sprite as a SVG, and I noticed a slight difference in color with the expected result. I tried the same with PNG export, and I'm getting a different result (in color) with the SVG export. I'll link my SWF file. Here is the commands I used for exports : SVG export : ``` FFDec -format sprite:svg -selectid 1849 -export sprite output_dir o5.swf ``` PNG export : ``` FFDec -format sprite:png -selectid 1849 -export sprite output_dir o5.swf ``` In the resulting SVG file, we can extract the PNG being used by opening the file with a text editor, extracting the base64 string and using a tool like https://onlinepngtools.com/convert-base64-to-png to convert it to a PNG file (so we can compare the results). I'll link the exported SVG file, exported PNG file, and the PNG converted from base64 (from inside the SVG file). Then we can use something like https://www.diffchecker.com/image-compare/ to see the difference in colors (linked the diff). The green color in the SVG export is darker than the PNG export. So I was wondering if this is a bug, something expected, or if I did something wrong with the options ?
Downloado5.swf (8,319 KiB)Downloadexported.png (65 KiB)Downloadexported.svg (310 KiB)Downloadbase64_from_svg.png (232 KiB)Downloaddiff.png (1,379 KiB)
Please try nightly 3111 and export the SVG again. The sprite has colotransform applied to it and it was not applied to image - now it should be applied correctly. I also noticed that the diffchecker may not work correctly for alpha channel images as I tried to upload 2 exactly same images (files) and the slider still has slightly differences, which is weird.
State: new→upgraded
Type: question→bug
Oh yes, you're right, diffchecker shows something different with the same image... That sucks... Thanks for your super fast answer and the explanation about colortransform, you're the best ! I've tried again with nightly 3112 (latest pre-release on Github), but I'm still having some difference.. I used the same commands to generate the PNG and SVG (I made sure the version was updated to 3112). With this tool : https://onlinepngtools.com/extract-png-color-palette I can extract the colors of the images (and the same image gives the same palette!) For the PNG file, the main green color is #90b61eda, but for the SVG file, the main green color is #789c1ed4. Not sure if it has anything to do with it, but I'm on Mac and I installed the nightly build using the pkg installer
Download1.svg (310 KiB)Download1.png (65 KiB)
Ohh, looks like I fixed it on wrong place... Please try nightly 3113, it should work now. Also make sure you compare the images in the same size - you need to export the Sprite PNG at 200%, since the Sprite downscales the image - in the SVG the image is original size as in Image 1370. If you know what I mean...
This should do the trick: FFDec -format sprite:png -zoom 2 -selectid 1849 -export sprite output_dir o5.swf
Godlike It works perfectly ! Thanks again
You're welcome.
State: upgraded→closed