Imgbot icon indicating copy to clipboard operation
Imgbot copied to clipboard

Optional better compression

Open TPS opened this issue 4 years ago • 13 comments

N.B.: @dabutvin I don't understand what ImgBot's official position is re: time vs. resources vs. speed for recompression, so if this request is out-of-line, do reply (make official note in docs, too, perhaps) & feel free to close.

ImageMagick is just ok when it comes to recompression. Better is @BenSchwarz's image-actions (pairing libvips w/ MozJPEG). Approaching state-of-the-art is @javiergutierrezchamorro's FileOptimizer (which combines entire toolchains & reports back via a UI). IIUC, each of these options defaults to lossless compression, but have optional lossy modes.

Would you consider integrating these as options?

TPS avatar Sep 02 '19 14:09 TPS

Hi @TPS ! Thanks for raising this.

I think this would be a great addition to ImgBot. I'm really drawn to extending the platform and giving the user options while providing sensible defaults.

I could see a configuration that allows you to choose, for example, your PNG Optimizer vs your JPG optimizer.

I love this idea! I think the best place to start is to add an interface for both lossless compression and lossy compression and implement it with the existing ImageMagick setup. Then we can implement the interface with any number of libraries and work on the best way to put the user in control of what kind of image optimization they are looking for.

roughly what I'm thinking

interface ICompress
{
  Task LosslessCompress(path);
  Task LossyCompress(path);
  string[] AllowedExtensions { get; }
}

And then implement with

class ImageMagickCompress : ICompress
{
   ...
}

dabutvin avatar Sep 09 '19 17:09 dabutvin

@dabutvin Thanks for your interest (even enthusiasm) for this. I do like your idea of implementing this in stages, in which case this issue would make a fine tracking issue. Maybe it'd be better to split off individual stages to their own issues? Then those could be labeled good first issue,help wanted, &c, which would better reflect their scope.

TPS avatar Sep 09 '19 23:09 TPS

I just opened the first one of these, we can add more as we think of them too. #488

We don't necessarily have to implement both lossless and lossy compression for every library, we can incorporate lossy only plugins as well.

Thanks for raising this issue @TPS this is a really good idea!

dabutvin avatar Sep 28 '19 19:09 dabutvin

Thanks for working @ it, @dabutvin. Wouldn't it be better, though, to keep this open, so it's readily found & subscribed to?

TPS avatar Sep 28 '19 20:09 TPS

Yeah good point :)

dabutvin avatar Sep 28 '19 20:09 dabutvin

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 27 '19 20:11 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 27 '20 05:01 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 30 '20 05:03 stale[bot]

If this is a long-term tracking issue, is there anyway to get @Stale to ignore it?

TPS avatar Mar 30 '20 11:03 TPS

@TPS indeed, there is :wink:

guntbert avatar May 29 '20 19:05 guntbert

Approaching state-of-the-art is @javiergutierrezchamorro's FileOptimizer (which combines entire toolchains & reports back via a UI). IIUC, each of these options defaults to lossless compression, but have optional lossy modes.

@dabutvin It looks like @devedse's Web Optimization Project will be kind of a superset of ImgBot, based on FileOptimizer. Maybe some cross-pollination might be useful?

TPS avatar Jun 21 '20 16:06 TPS

Hey all, if you guys are interested in some collaboration let me know :).

devedse avatar Jun 21 '20 20:06 devedse

👋 Hello and welcome @devedse

dabutvin avatar Aug 08 '20 23:08 dabutvin