Skip to content

What is the best way to render a pixel-perfect pixel-art image? #70

Answered by acxz
NNBnh asked this question in Q&A
Discussion options

You must be logged in to vote

I spent some time trying to tackle this issue as I think I got a reasonable solution:
I found that -filter did some blurring so I wanted to avoid that option and just use -scale for exact pixel replication.

For the following image:

Running just chafa:

Running:

convert in.png -scale 800% out.png
chafa --scale 1 out.png

We get the pixel perfect:

Note for some small images this doesn't work so well, but for most sprites the above will serve you well.

Here is an example of another image with the prescaling done for chafa and comparing it with timg's output:

Chafa w/ prescaling:

Timg's output with original file:

I would love if there was a mode for pixel perfect display in chafa that so…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@acxz
Comment options

@hpjansson
Comment options

@acxz
Comment options

@hpjansson
Comment options

@acxz
Comment options

Answer selected by NNBnh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants