Show HN: Fixing Google Nano Banana Pixel Art with Rust

github.com

187 points by HugoDz 7 days ago


krisoft - 2 days ago

It feels weird to me that on the before/after comparision they felt the need to zoom in on the “before” but not on the “after”.

Either both should have the magnifying glass or neither. This just makes it hard to see the difference.

vunderba - 2 days ago

Nice. There's a couple of these (unfake which uses pixel snapping/palette reduction, sd-palettize which uses k-means to palette reduce, etc.) that I've used in the past in a Stable Diffusion -> Pixel Art pipeline.

I think it'd be worth calling out the differences.

[1] - https://github.com/jenissimo/unfake.js

[2] - https://github.com/Astropulse/sd-palettize

jasonjmcghee - 2 days ago

I can't explain it, but it's like uncanny valley pixel art. Like the artist hasn't done the final polish pass maybe?

Maybe it's the inconsistent lights/shadows?

Maybe a pixel artist has the proper words to explain the issues

lxgr - 2 days ago

I'd love this, but for removing "transparent background" checkerboards.

Nano Banana beats it on many other dimensions, but this is one thing that gpt-image-1 usually does much better.

badmonster - 18 hours ago

What was the specific pixel art problem with Google's Nano Banana that this Rust project solved?

IgorPartola - 2 days ago

This is perfect! I have had such a time with Nano Banana asking it to generate some very simple pixel art. One of the worst things is that it cannot seem to generate transparent backgrounds or even solid ones. It’s always some blotchy cloud of off-white pixels or a simulated fuzzy grid that shows up in some places. I will need to give this a try to clean up some of what I had to try by hand.

threeducks - 2 days ago

Could you explain a bit how the code works? For example, how does it detect the correct pixel size and how does it find out how to color the (potentially misaligned) pixels?

andai - 2 days ago

At last! I have been dreaming about such a tool for years. I often find pixel art that has been scaled or poorly compressed. So it's a bunch of fuzzy squares. Can't wait to try this.

29athrowaway - 2 days ago

Another annoyance of Nano Banana (and its Pro version) is that it cannot generate transparent pixels. When it wants to, it creates a hallucinated checkerboard background that makes it worse.

westoque - 2 days ago

> Current AI image models can't understand grid-based pixel art.

sounds like a good use case to fix this problem from the model layer. an image gen model that is trained to make pixel perfect art.

razster - 2 days ago

That's an actually nice setup. Have you looked at Z-Image and the Pixel LoRA that was released? I've found it works fairly well at keeping the pixels matched with the grid.

LorenDB - 2 days ago

How is the "with Rust" part relevant?

- 2 days ago
[deleted]
jtfrench - 2 days ago

Go Hugo!

cipehr - 2 days ago

Is it possible that some of the reason pixels are messed up is because of the watermarking? https://deepmind.google/models/synthid/

Or is it purely because the models just don't understand pixel art?