I Built Imager Because I Was Tired of Ugly Image Resizing

I recently finished something that’s been scratching a very specific itch I’ve had for a while: a small Python library for resizing and composing images in a way that just makes sense.

You know that frustration when you need to fit an image into a specific size, but it’s the wrong aspect ratio? You either end up with awkward black or white bars or you lose important parts of the image.

I ran into this constantly (preparing thumbnails for articles or social media posts) and the existing solutions felt either too heavy or too manual.

What It Does

Imager takes any image and fits it into whatever dimensions you need. And it has an artistic part: instead of padding with boring solid colors, it creates a blurred background from the image itself.

You can see it in action on my websites Incredibilia.ro or Curiozitate.ro. All featured images are created using this library. See this example for a resizing result (small centered image with white border pasted on a blurred background).

The results feel organic, like the images naturally belong in that space.

You also get control over borders, transparency, and whether to crop aggressively or preserve the entire image. It’s a tool that has been living scattered in at least four different project of mine (basically, I was reinventing the wheel every damn time). I should have built it as a library years ago.

An Example

from PIL import Image
from imager import Imager, Config

input_image = Image.open("example.jpg")
imager = Imager(output_size=(1920, 1080), config=Config())
output = imager.process_image(input_image)
output.save("output.jpg")

That’s it. A 200×150 pixel image becomes a polished 1920×1080 composition with a blurred background and clean border.

Why I Built It

This started as a weekend project to automate something I was doing manually in Gimp. But as I refined it, I realized it might be useful to others facing similar challenges. It’s not intended to be a full image editing suite, just a focused tool that does one thing well.

If you work with images in Python and need smart resizing without the fuss of larger frameworks, give it a try.

Leave a Comment