News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Downscaling-Algorithm of Icons

Started by Leartin, May 06, 2014, 09:09:29 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Leartin

I noticed that with the themes, icons get scaled to 32x32, whatever their actual size is, which means creating 64x64 Icons (just in case someone uses a big-button-theme) seems plausible.
If the downscaling algorithm is simple enough that each pixel of the 32²-size-icon is only determined by the four equivalent pixels in the 64²-size-icon, in a way a human can understand (like, maybe it's simply always the upper left pixel of the four... something like that) it should be possible to create 64² icons which look exactly the same at 32²-size as they do now. (Creating just any 64²-size icon wont do, as most players will probably still play with 32² buttons, so those are the more important ones)

I'd be glad if there is a answer to this simple enough that I can understand.

An_dz

The code probably uses Bicubic algorithm for reduction. What you explained is like Nearest Neighbor, it's used when enlarging the graphics.

prissi

For scaling from 64 to 32 (or vice versa) the code uses no interpolation, just leaves away every second pixel. It only uses interpolation for other scaling factors.

But indeed, supplying 64  x64 icons might be a good idea, because in the future with all those high res and tablets around, larger icons (als well as GUI and fonts ... ) seem very likely.

Leartin

Quote from: prissi on May 07, 2014, 10:09:43 AM
For scaling from 64 to 32 (or vice versa) the code uses no interpolation, just leaves away every second pixel.

So, it's indeed the upper left pixel of the bunch? (every second pixel +every second row gets discarded)?
In that case, the idea might work :) I'll have to test that.

An_dz

Quote from: prissi on May 07, 2014, 10:09:43 AM
For scaling from 64 to 32 (or vice versa) the code uses no interpolation, just leaves away every second pixel. It only uses interpolation for other scaling factors.
My test doesn't output this. Attached an image showing my result from 32 to 16 with 500% zoom.

If that is not an interpolate image then I have no idea what interpolation is. And btw, this looks like bilinear.

Leartin

True, I tried it myself...

First row: Old Icons
Second row: New Icons, 64x64 scaled down to 32²
Third row: New Icons, original size
Fourth row: Old Icons, 48² (as is used in big standard theme)
Fifth row: New Icons, 48²

Now they don't look too bad, even with interpolation, it might pay to just let them scale.

Dwachs

Quote from: An_dz on May 07, 2014, 01:11:46 PM
My test doesn't output this. Attached an image showing my result from 32 to 16 with 500% zoom.

If that is not an interpolate image then I have no idea what interpolation is. And btw, this looks like bilinear.
The downscaling is doing interpolation. With special treatment of special colors.
Parsley, sage, rosemary, and maggikraut.

Leartin

Is there any chance we might get the option to define multiple Icons in different sizes for each object, so that the fitting one is picked (32², 48², 64²), but if not available, created by scaling the biggest available button? That would be a much cleaner option...

Flemmbrav

thanks leartin, that would be really nice!
the downscaled icons are unlookable for me => small headaches - I'm sorry about that.

An_dz

Use nearest-neighbour when enlarging is an option as well.

Leartin

Quote from: An_dz on May 08, 2014, 01:40:11 AM
Use nearest-neighbour when enlarging is an option as well.
Not really.

In the attachment, the first row are the normal icons, enlarged to 48² with nearest neighbour. And it looks terrible. :(