Sharepiece 2/5: Resizing a Crab

Posted Tuesday, September 16, 2025 by Sri. Tagged JOURNAL
a pixelated dancing or angry crab

You can see how much space there is around the crab!

Animated Crab uploaded by oleksiis on IMGUR. My guess is that this is a game asset sprite. It's unclear whether the uploader is the original artist; let me know if you know the original source!

There is an animated pixel crab that I'm quite fond of, but it doesn't fill its 256x256 grid space. Today's Sharepiece is my experience trying to use GIMP to edit it into a larger Discord Emoji. While it isn't quite working, I'm noting the steps I took.

The Goal

Embiggen the crab!

Step 1: Crop the Crab to Content Size

After loading the original GIF into GIMP, it shows that there are 4 different layers. By editing the layers, you can change the animation. I'm not doing that, but I do want to crop it down so the crab will appear much bigger in the 32x32 space that is allocated for it as an Discord Reaction. It will render at 128x128 if the Emoji is entered by itself on a chat line.

To do that, there's a command that will scan all the layers and "crop to content".

Crop to ContentScreenshot of GIMP, showing CROP TO CONTENT commandScreenshot of GIMP, showing CROP TO CONTENT command (full size image)

You can see that the crab has been smooshed down. The image shows ALL the frames, which is why it looks blobby.

Step 2: Determine the Pixel Scaling Factor

Because this is pixel art that has been scaled-up, we want to know what the original art size was. We want to maintain a power-of-two size for clean scaling of pixel art; this is a general principle for designing pixel assets for a video game. It might not actually be necessary for Discord, but old habits die hard.

Determine Pixel Scale is 8Screenshot of GIMP, showing use of select tool to determine dimensionsScreenshot of GIMP, showing use of select tool to determine dimensions (full size image)

Anyway, you can see that the dimensions of the box is 8x8, so the original asset was scaled by 8 times. Since the content width of the crab is 144 pixels, we can divide that by 8 to see that the original size was 18 pixels. It was likely a 32x32 sprite originally, if it's from an old games. Or, it could have been drawn larger because pixel art for modern games aren't constrained by low resolutions like we were back in the early 1990s. Now, it's just an art style!

Step 3: Squaring Things Up

Discord Emoji (and Emoji-type graphics in general) are square aspect, meaning their width matches the height. So, it's a good idea to make sure the asset is the same.

Set Image Canvas Size as multiple of 8 pixelsScreenshot of GIMP, showing resizing of canvas to multiple of 8 pixelsScreenshot of GIMP, showing resizing of canvas to multiple of 8 pixels (full size image)

First I checked that 144 was evenly-divisible by 8 (our measured pixel scaling factor from before), which should ensure that scaling down will be even.

Next, I used the Set Image Canvas Size command works here, because we're not scaling the actual pixels up. The cropped content box is 144x112, so we want to resize the canvas so the width is the same as the height.

Step 4: Re-exporting the Animated GIF

When there is more than one image layer, GIMP will export each layer as an animation frame.

Export as Animated GIFScreenshot of GIMP, showing Export Image as GIF optionsScreenshot of GIMP, showing Export Image as GIF options (full size image)

I set these options:

  • loop forever option makes the animation loop. Not all display programs actually support this, but we can set this as our preference.
  • frame disposal when unspecified option probably tells the GIF renderer in Discord to erase each frame before drawing the next. Turning it off is an optimization technique when you've designed a GIF to have unchanging areas in frame 1, and frames 2 and onward just change tiny parts that "self erase". If I don't turn on frame disposal, then the crab will just be a shimmering blob rather than a clean animation.

Aside: As an animated GIF editor, GIMP isn't really designed like a "real" bitmap animation program like the venerable DeluxePaint, Director, or Debabelizer software I used to use in the 1990s. I miss those tools.

The Result

Not as clean as I would have liked. Here's what the new one looks like compared to the old one.

The Aftermath: Not clean!Screenshot of Discord Emoji Uploader, showing undesired white fringingScreenshot of Discord Emoji Uploader, showing undesired white fringing (full size image)

There is white fringing around my version, whereas the original smaller version seems to be properly anti-aliasing to the background color.

Usually white fringing is causes by assuming the wrong blending algorithm (e.g. straight versus premultiplied rgba) or some inconsistency with how the GIF exporter generates transparency. It seems more likely, as GIF is an indexed color format, that I messed up the palette table or there is some assumption about what pixel color is considered "transparent". GIMP doesn't seem to provide this level of insight in the UI, so I probably need to look at using some other program if I can't find a solution.

Will update this as I find out more! I suppose another possibility would be to give up on animated GIF and try a more modern format like animated PNG if Discord supports it.

Sharepiece Evaluation!

The idea behing this Sharepiece Challenge is to pick something that helps get unstuck with one's creativity/productivity. It's an experiment to uncover what works for people and what does not. That said, there are just a few criteria: small scope, can see, can share.


 EVALUATION for 9/16

 . lightly scoped:  PASS
 . can see or hold: PASS
 . easily shared:   PASS

 Elapsed Time:      4.5 hours (!)

This took much longer than I thought it would, largely due to the documentation that went into making this blog post and enhancing the blog's RSS feed "excerpt" system for "hidden" excerpts that show up only in the RSS feed. The actual time goofing around with GIMP was maybe an hour.

I might have to consider whether blog posts themselves are their own deliverable. They are NOT lightweight tasks when documentation of steps is involved. Hmm. Something to think about.


Let's converse via Mastodon or Bluesky! Include the entry id /journal/2025/0916/ so I know what we're talking about 🙂