• Resolved ctrlaltdelete

    (@ctrlaltdelete)


    I have images that are small resolution (old games) and i want to retain the crisp pixel perfect only PNG guarantees. I see that even if i try to convert those PNG to JPG it won’t do it, probably because for these kind of images PNG always produce a smaller size than PNG, examples:

    PNG low res

    The beauty in these is that i can show them in full screen using:
    image-rendering: pixelated;
    And they will look crisp.

    I want to turn ON convert PNG to JPG but, is it safe to assume these will never be converted to JPG?

    If it’s not safe. I was wondering if you would like to add an option to control the automatic conversion to JPG that happens when a file size is bigger than 300KB?

    If i could lower that to say 50KB i could be sure none of these small PNG will get converted while the larger images that really, should be JPG get converted.

    Does that make sense?

    Since this is probably specific to my case, could you point me to the file that controls those 300KB so i can reduce it on my end without bothering everyone else?

    EDIT: Could this be it? https://github.com/nosilver4u/ewww-image-optimizer/blob/master/common.php#L6259

    • This topic was modified 3 years, 11 months ago by ctrlaltdelete.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    That’s exactly it, the ewww_image_optimizer_autoconvert_threshold filter is the one to use. The value is in bytes, so go ahead and set it to whatever you like!

    Thread Starter ctrlaltdelete

    (@ctrlaltdelete)

    Seems to be working good. Does it affect the bulk optimizer too? Or only to new uploads?
    Thanks for great plugin.

    Plugin Author nosilver4u

    (@nosilver4u)

    It’s only for new uploads. And you’re very welcome, we love helping people make their sites faster!

    Thread Starter ctrlaltdelete

    (@ctrlaltdelete)

    You are the best at it. =D

    Something i noticed i don’t know if its by design:

    When the automatic conversion happens, on the media library savings table seem to be comparing the converted JPG vs the optimized JPG instead of the original PNG vs the optimized JPG.
    Making it look like the savings are a lot smaller than what they really are.
    I thought it’s worth mentioning.
    https://ibb.co/BqFxQqW

    Plugin Author nosilver4u

    (@nosilver4u)

    Thanks for pointing that out, it’s tricky to capture the pre-conversion results for that, but the plugin *does* track such things when scaling an image down, which happens around the same area.
    So we can probably improve that without too much hassle, so I’ll take a look for the next release.

    Thread Starter ctrlaltdelete

    (@ctrlaltdelete)

    Thanks glad to find something useful somewhat. I swear that’s all.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Control automatic PNG to JPG threshold?’ is closed to new replies.