Search code examples
imagefilepngpastefyne

Displaying or attaching my program-generated .png file is distorting it


I am generating a texture image with my program. It is both being saved as a file and displayed in the Fyne GUI.

The file looks brighter and clearer. The display on the GUI is dimmer and has additional lines on it. It makes the image in the display look worse.

I was wondering if this is a formatting feature with Fyne.

On the other hand this distortion appears whenever I paste or attach one of these images.

The image on the top here has only had the distortion applied once, by pasting it in this question.

The one on the bottom has had it twice, one from pasting it and once from the display on the GUI better image quality from file

poorer image on the display

is there a way to get rid of this distortion?


Solution

  • It is probably due to scaling mode (assuming the image does not exactly fit the number of pixels on screen). An image editor / viewer app may optimise for Image display in a way that the GUI toolkit is focused on speed or other aspect. Try out different ScaleMode options for your canvas.Image.