lunapaint / vscode-luna-paint

A raster image editor extension for VS Code
https://marketplace.visualstudio.com/items?itemName=Tyriar.luna-paint
279 stars 25 forks source link

Image visualization corrupted #173

Open demolitions opened 1 year ago

demolitions commented 1 year ago

When opening any image in Luna Paint, corruption is displayed but only in visualization. Any edit to the image is correctly saved. I'm attaching a screenshot of the VSCode view, and the edited image, saved in Luna Paint.

This happens on 3 different laptops, with different hardware configurations, all with Arch Linux.

OS: Arch Linux CPU: Ryzen 7 different models GPU: integrated AMD different models (Lucienne, Renoir), NVidia GeForce GTX 1650 Ti via prime-offload RAM: 8GB and 16GB VSCode version: 1.75.1 and 1.76.0 on Electron 19.1.9 and 19.1.11 (respectively)

Screenshot: Screenshot_2023-03-08_14-39-59

Saved image: load

No errors related to Luna Paint in VSCode developer console.

Tyriar commented 1 year ago

I know there is an issue where a 1px horizontal line may appear at certain zoom levels, I haven't seen the other corruption though. Does zooming in fix the display?

Since this doesn't seem to occur on other configurations my gut feeling is that it's an issue with GPU/Arch/Chromium interaction.

demolitions commented 1 year ago

I can say that zooming does not change anything, only the pattern of corruption (thinner lines, less or more scattering). I can also say that there is no difference between OSS and MS binary versions of VSCode (both on 19.1.9) One of the laptops having this issue is using the nvidia GPU instead of the integrated amd, and another is using an external screen via DisplayLink un USB3, so I don't think it's a graphics driver issue.

I can see if I have an intel system around, and try the same thing with the same Arch Linux installed, to keep most of the variables unchanged.

Will also try with another distro on one of the current laptops.

Tyriar commented 1 year ago

I suspect I won't be able to fix the issue on my end, other than by creating a software renderer which I don't really have the time to do now, particularly the little transparent dots since the way the renderer works is by displaying several image width tiles.

Vortetty commented 1 year ago

can see if I have an intel system around

it happens across every system i have access to seems to be more of a bug with vscode than with lunapaint, the missing pixels are seen by the web renderer as insignificant so it skips them, the lines being horizontal are because html is rendered horizontally, though i do see some triangular/rectangular chunks missing, likely from the same not rendering due to insignificance in all my testing zooming in until the pixels become larger does help alot but not until they are way larger than would otherwise be significant

as for a possible solution, if you could put a canvas behind the gui, and then render the image to that as a whole image not pixels, that may help though would not be the simplest, especially with the sandboxing vscode does, and lack of time,but with a change to the rendering it seems it should be fixed, just an odd interaction with how all of the rendering works

as for the transparent tiles, you could pre-generate something that fits the screen then render that behind the main image on the canvas