kohler / gifsicle

Create, manipulate, and optimize GIF images and animations
http://www.lcdf.org/gifsicle/
GNU General Public License v2.0
3.77k stars 239 forks source link

Feature req: Upscaling mode for --resize-fit #67

Closed papandreou closed 7 years ago

papandreou commented 8 years ago

(I originally posted about this on a closed issue, which is probably not the best way to be heard :)

I'm working on an image processing service that supports different engines depending on the type of the image to be processed. Gifsicle seems to be the only thing out there that doesn't screw up weird animated gifs with differently sized frames, so the idea is to use gifsicle when both the input and output formats are gif.

The most common operation that I need to support is to scale the image to fit into a bounding box, which maps fine to --resize-fit WxH, except when the source image is smaller, in which case it has to be scaled up (depending on a mode flag). I cannot accomplish that with gifsicle without knowing the image metadata up front, as --resize-fit never scales up, and --resize-width/--resize-height cannot be used together.

So how about adding support for scaling up? Sort of like *magick's > geometry (turns off upscaling) modifier or sharp's withoutEnlargement()?

kohler commented 7 years ago

You want the new --resize-touch argument.

papandreou commented 7 years ago

Fantastic, thanks a bunch!