WordPress.org

Ready to get started?Download WordPress

Forums

EWWW Image Optimizer
png2jpg please please (7 posts)

  1. ivnus
    Member
    Posted 1 year ago #

    first off Great plugin!

    Could you implement the feature for png2jpg? Would love to see this added since full image png don't really optimize.

    http://wordpress.org/extend/plugins/ewww-image-optimizer/

  2. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    well, png2jpg isn't really an option, as it only runs on Windows, but the idea is one I've tossed around since I first started the plugin for both converting gif to png and for png to jpg. It's quite a bit of work though, and I'm not sure on the implementation of it, so perhaps I'll pose a couple questions to you.

    The ultimate long-term solution (I think) is to let the user know that a conversion would produce a smaller image and offer a link by the image in the media library to replace it with the new format. For PNGs, we have to be concerned with transparency, since JPG does not support transparency. For GIFs, we have to look out for animation, since PNGs don't support animations. One other problem with the PNG to JPG process is that this is not a lossless operation. It may not be noticable but it is still an irreversible loss of pixels. We would likely also need to have a quality setting for JPGs so that the user can choose what level of lossiness is acceptable. In any case, I think keeping the original image around is critical and unless we can auto-detect the transparency and animation issues, bulk operations are completely out of the question.

    All that said, there are short-term solutions which may be acceptable (they would require the user to download, and then re-upload the converted image), which would you prefer?
    1. when the image is optimized, we do a test conversion in the background and store it alongside the original if it results in a smaller image. We then give the user the opportunity to download the new smaller image via the media library page.
    2. when the image is optimized, we do a test conversion in the background, but do not store the new image, we only present a similar message to #1 and re-do the conversion on the fly if they click the download link on the media library page.
    3. forget short term, it is too inconvenient, and focus on the long term (as long as 4-6 months out).

  3. ivnus
    Member
    Posted 1 year ago #

    thank you for the response nosilver4u, much appreciated.

    I was thinking more along the lines of using somthing like imagemagick to perform the conversion.

    Imagemagick:
    http://www.imagemagick.org/script/index.php

    What you think about this solution?

  4. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    That's the one I was looking at using. If you could give me more feedback on the options I presented, that would be helpful too.

  5. ivnus
    Member
    Posted 1 year ago #

    My current problem is large PNG images that don't optimize down (PNG 32) no matter what you do to them, so converting them to JPG is the best solution.

    I imagine the PNG to JPG option should be as follows:

    Admin Screen Options:

    • A check box in admin to turn png2jpg on/off
    • background color for png
    • installation instructions to imagemagick

    Hook Process
    Then, during the upload process, hook only if option png2jpg is true, then convert png2jpg and return the jpg to the media uploader, delete uploaded PNG.

    For my needs:

    • white background / no transparency
    • Images png2jpg with smallest possible size 60% quality
    • saving the original PNG is not necessary
  6. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, I'll add it to the roadmap, but don't hold your breath. Probably at least 4 months out, unless I magically have loads of freetime in the near future. We'll leave it 'not resolved' to make sure I don't forget about it.

  7. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    so magic happens, the changes are in the -dev version right now if you want to try them out. I'll be releasing probably this weekend. If you don't specify a background, it skips transparent PNGs, and if you don't specify a JPG quality, it goes with the optimal quality setting which is auto-detected based on the image.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic