7

I'd like to resize an animated GIF image of some pixel art.

I'm on macOS and am comfortable with the command-line.

1
  • 1
    Animated GIF. I'll update the question.
    – Tim Swast
    Mar 24, 2017 at 3:08

1 Answer 1

8

I used Gifsicle to do this. You can install it with homebrew.

brew install gifsicle

Then, to resize an image using nearest-neighbor interpolation, run

gifsicle --resize 512x512 --resize-method sample doodle002.gif > doodle002-big.gif

From the manual for the --resize-method parameter:

The ‘sample’ method is a point sampler. Each pixel position in the output image maps to exactly one pixel position in the input, so when shrinking, full rows and columns from the input are dropped.

Even though this doesn't explicitly say "nearest-neighbor interpolation" the described method sounds exactly like nearest-neighbor.

2
  • oop, typo in gifscicle for the copy-pasters out there Aug 20, 2018 at 15:33
  • @andrewxhill Thanks! I've updated the brew command.
    – Tim Swast
    Aug 21, 2018 at 4:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .