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?
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.
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.
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.
The borders of shapes are all wrong. It’s not too complicated. There is a small vocabulary of valid border patterns (e.g. a line rising one pixel up and two pixels right) that none of these generative models adhere to.
There are more details in the fixed version too, e.g. an extra detailed dark line within right leg (tibia) that is not present in the original; where do these details come from?
The purpose of zoomed out comparison is to show the quality reduction of applying this tool. The purpose of zoomed in before picture is to show how a typical pixel misalignment. Aligned pixels can be easily imagined.
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.
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.
18 comments
[ 2.8 ms ] story [ 41.8 ms ] threadOr is it purely because the models just don't understand pixel art?
I think it'd be worth calling out the differences.
[1] - https://github.com/jenissimo/unfake.js
[2] - https://github.com/Astropulse/sd-palettize
Maybe it's the inconsistent lights/shadows?
Maybe a pixel artist has the proper words to explain the issues
Either both should have the magnifying glass or neither. This just makes it hard to see the difference.
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.
Nano Banana beats it on many other dimensions, but this is one thing that gpt-image-1 usually does much better.