-
Notifications
You must be signed in to change notification settings - Fork 783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glitch: Color Values can change when saving and reloading #1016
Comments
|
Hi, Piskel relies on the browser to preserve colors when using a few APIs around canvas. I guess that what happens here is that when Chrome is asked to turn the canvas into a PNG image (which is how it gets saved), for some reason it will perform a lossy compression. This is probably hardware dependent. I guess that Chrome delegates this kind of instruction to the graphics card if hardware acceleration is turned on for instance. The alternative would be to re-implement a save that manually creates a proper PNG (or any other lossless image format). It's bound to be a lot slower, but I guess it can be done and proposed as a setting for users experiencing color corruption such as this. In the meantime could you:
Also can you confirm this only occurs when saving and not before? |
It's possible that we could reuse ArrayBufferSerializers now. When it was initially implemented in 2016, the browser support for those APIs was a bit poor. But now it seems to be better across the board. I wonder if this would solve the issue. I will try to put a modified version of the editor online which can save using arraybuffer. Basically need to undo 2a7957b |
Interesting! On my desktop, the error did not appear to be present on Firefox or Edge, which is great! I know you don't support Opera, but I wanted to confirm that it wasn't a Chromium error, so I tested it on Opera as well. As far as I can tell, this is exclusively a Google Chrome glitch. I can't replicate it on any other browser. I made a demo file in Firefox, edited it in Edge, and loaded it repeatedly between the two, and did not have the color glitch show up. However, the moment that I loaded the uncorrupted file into Chrome, the color glitch appeared again. Alternatively, when I work on the project in Chrome, save it in Chrome, then open it up in Firefox or Edge, the color glitch is also present. So it looks like any time the canvas is saved or loaded in Chrome, the glitch is present. I think your theory on lossy compression is probably spot-on. Also, I have been unable to replicate the glitch without saving as of yet. So the TL;DR is:
p.s. - the error was present both with hardware acceleration off and on |
Graphics Feature Status
Problems Detected
Version Information
Log Messages
|
This is a bug I have just experienced, not by downloading and then re-uploading the sprite, but during editing: the sprite will suddenly become corrupted/compressed into dozens of shades of every color unexpectedly. It is absolutely infuriating to me - I tried to download the sprite I was working on, opened gimp, converted it to indexed colors then re-uploaded it back to Piskel and it is still affected. Coincidentally, I use the latest version of Brave which runs on the same engine as Google Chrome. If this is a problem with the browser and not Piskel per se I would like to enable or disable whatever is causing this, this didn't happen before. |
This bug kept happening again and again with me on the online, browser version of Piskel. I downloaded the current offline version, chose a color and completely recolored my sprite but it has happened frequently over my last project. I'm using Firefox and I have no idea what to do. |
Color values change when saving
Steps to reproduce the bug
Environment details
Sprite details
Example: Below, I drew in only complete black (#000000) and red (#FF0000), but when I exit and reload, the singular black turns into various shades of black.
The text was updated successfully, but these errors were encountered: