Using display.save jpeg format saves at low quality, even when specified at the highest quality level

Hi Corona!

I have been using display.save for my photo app and have noticed a glaring issue with the jpeg quality. Even when you set the jpegQuality parameter to 1, the quality is still very low!

corona 100% quality jpeg (i.e. jpegQuality=1 ) :

5GwkfIe.jpg

paint.net 100% quality jpeg:

govfOdC.jpg

As you can see there is a lot of distortion on the hearts in corona’s version while the paint.net version is crystal clear.

Is there a bug in the display.save api that is not actually using the best quality for jpegs even when specified? Or perhaps the algorithm used in corona for jpegs is outdated?

I would really like to use the jpeg format and not png because jpeg file size is so much smaller, even when set to 100% quality. 

Please advise, thanks!

+1

I agree. I too have this problem. Image quality is poor despite setting to highest quality.

Waiting for response from Corona still… :smiley:

Specify a filename ending in .png and you’ll get a lossless image.  JPGs are better for photographs than for screenshots.

Having just re-read your post I see that you considered PNGs but think they are too large.  I think what I said above generally holds true on devices.  What platform are you running on?

@Perry - Android and iPhone. As I explained in my original post, it appears there is something wrong with the way Corona is saving jpeg images. A jpeg quality image set at 100% should look like the one from paint.net, however Corona produces a subpar jpeg image, even when the quality setting is set to 1.

Corona uses the image encoding available on the platform it’s running on. 

Here’s the output of a slightly modified version of the ScreenCaptureToFile sample (the circles and photo were added to make it more like your screenshot above):

Assuming we’re talking about the artifacts in the solid colored areas, you can see my screenshot doesn’t seem to suffer from that so there’s clearly more going on than meets the eye.  I’m using the default “jpegQuality” of 1.0 and the sample was run on iOS 7.1.2

So, if you could file a bug with a sample app that demonstrates the problem (also include the full size images and an explanation of what’s wrong with them to your eye) then we can take a look and see what’s going on.

If you just post the display.save() code you’re using I can take a quick look at that even more quickly though I suspect it’ll be fine.

Note the thumbnail shown by the Forum software is horribly compressed, you have to click on it to see the correct bits :slight_smile:

Hmmm interesting! I will have to investigate further I guess. I’ll try to get something nailed down in a sample project as you suggested when I have some spare time. Thanks for your reply :smiley:

+1

I agree. I too have this problem. Image quality is poor despite setting to highest quality.

Waiting for response from Corona still… :smiley:

Specify a filename ending in .png and you’ll get a lossless image.  JPGs are better for photographs than for screenshots.

Having just re-read your post I see that you considered PNGs but think they are too large.  I think what I said above generally holds true on devices.  What platform are you running on?

@Perry - Android and iPhone. As I explained in my original post, it appears there is something wrong with the way Corona is saving jpeg images. A jpeg quality image set at 100% should look like the one from paint.net, however Corona produces a subpar jpeg image, even when the quality setting is set to 1.

Corona uses the image encoding available on the platform it’s running on. 

Here’s the output of a slightly modified version of the ScreenCaptureToFile sample (the circles and photo were added to make it more like your screenshot above):

Assuming we’re talking about the artifacts in the solid colored areas, you can see my screenshot doesn’t seem to suffer from that so there’s clearly more going on than meets the eye.  I’m using the default “jpegQuality” of 1.0 and the sample was run on iOS 7.1.2

So, if you could file a bug with a sample app that demonstrates the problem (also include the full size images and an explanation of what’s wrong with them to your eye) then we can take a look and see what’s going on.

If you just post the display.save() code you’re using I can take a quick look at that even more quickly though I suspect it’ll be fine.

Note the thumbnail shown by the Forum software is horribly compressed, you have to click on it to see the correct bits :slight_smile:

Hmmm interesting! I will have to investigate further I guess. I’ll try to get something nailed down in a sample project as you suggested when I have some spare time. Thanks for your reply :smiley: