Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeffrey Weinstein 67 posts 313 karma points
    Jul 29, 2019 @ 17:46
    Jeffrey Weinstein
    0

    Compression of generated images via remote service

    Hello, I would like to employ some badass compressing service like tinyPng or tinyJpg, they have API so that should be easy. I'm interested to compare results with built in image processor.

    Anyhow. I'm looking for a way where I can hijack the end of "thumbnail" creating process and on top of cropping etc perform a compression on the image.

    Does anyone knows how can I do that?

    Cheers, Vojta

  • Marc Goodson 2157 posts 14435 karma points MVP 9x c-trib
    Jul 29, 2019 @ 21:16
    Marc Goodson
    100

    Hi Vojtech

    Have you looked at the ImageProcessor post processor dll?

    https://imageprocessor.org/imageprocessor-web/plugins/postprocessor/

    you drop it into your site and it uses

    gifsicle : http://www.lcdf.org/gifsicle/ truepng : http://x128.ho.ua/pngutils.html pngquant : https://pngquant.org/ jpegtran : http://jpegclub.org/ mozjpeg : https://github.com/mozilla/mozjpeg

    to provide further optimisations...

    but if you want to try your own thing, then there is a PostProcessor Event that ImageProcessor fires for a request, which you could handle and then provider further optimisations:

    https://github.com/JimBobSquarePants/ImageProcessor/blob/1c65565c7f42fa5e9917fbe408d7df3827c607bb/src/ImageProcessor.Web.Plugins.PostProcessor/PostProcessorApplicationEvents.cs

    regards

    Marc

  • Jeffrey Weinstein 67 posts 313 karma points
    Aug 03, 2019 @ 11:01
    Jeffrey Weinstein
    1

    I run an experiment,

    and I realized the postprocessor is kinda not useful, truthe is I was runing it with quality set to 65, and lower the quality lesser the effectiveness of additional compression. The difference with and without postprocessor was 2% on 65 quality output from imageprocessor.

    Than I integrated Tinify nuget package and I got better results

    65 quality 15% difference in size

    95 quality 36% difference in size

    85 quality 20% difference in size

    So I went with 85 quality for visible thumbnails and 95 for a lightboxed images including the Tinify pipeline..

    It will take some time initially, but it will get cached by CDN, so that's totally okay..

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies