this post was submitted on 27 Oct 2023
54 points (77.6% liked)

Programmer Humor

32410 readers
1 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
top 8 comments
sorted by: hot top controversial new old
[–] nothacking@discuss.tchncs.de 6 points 2 years ago (1 children)

And in the end you turned it back to an image.

[–] Vitaly@feddit.uk 1 points 2 years ago

because tiles like this are not supported on lemmy

[–] MrPoopyButthole@lemmy.world 3 points 2 years ago (1 children)

What languages did you come to rust from?

[–] Vitaly@feddit.uk 10 points 2 years ago

Python... you can guess by my shitty code

[–] blotz@lemmy.world 2 points 2 years ago (1 children)

Very cool! Did you consider any other interpolation algorithms?

[–] Vitaly@feddit.uk 1 points 2 years ago (1 children)
[–] blotz@lemmy.world 11 points 2 years ago* (last edited 2 years ago) (1 children)

Its the mathematical term for estimation and constructing new data from existing data. In the context of what you are doing, it's resizing images.

You are doing something called linear interpolation. This works great for shrinking an image. However, have you considered what happens when your ASCII resolution is greater than your image resolution? This is where bilinear and bicubic interpolation come in.

These algorithms are cool but are also massive overkill for your average use case. They only make a different in a very niche use case (when your ASCII resolution is greater than your image, such as pixelart)

Great code! Very cool

[–] Vitaly@feddit.uk 2 points 2 years ago

thank you so much! have a good day!