Image Upscaling And Downscaling Algorithms

XnConvert Multi Platform - Windows, MacOSX, Linux
bdragon
Posts: 103
Joined: Mon May 01, 2017 8:06 am

Image Upscaling And Downscaling Algorithms

Postby bdragon » Sun Jun 18, 2017 5:42 pm

May i propose a weird idea?

Let's say a person wants to have all the images in a folder oround the same size, while still respecting proportions.

Would it be possible to allow to choose different algorythms for upscaling and downscaling depending on what it is encountered?

And also: if the image is going to be upscaled by a lot, would you allow to be able to choose along the usuals (like lanczos) something drastic like:
https://en.wikipedia.org/wiki/Pixel_art ... algorithms
or even
https://johanneskopf.de/publications/pi ... /pixel.pdf

Yes, i know: these are very edge cases, but if nobody ever asks if it would be appreciated, then nobody ever knows it might be needed or wanted.

Thank you for your time.

User avatar
XnTriq
Moderator & Librarian
Posts: 5048
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Image Upscaling And Downscaling Algorythms

Postby XnTriq » Sun Jun 18, 2017 10:00 pm


bdragon
Posts: 103
Joined: Mon May 01, 2017 8:06 am

Re: Image Upscaling And Downscaling Algorythms

Postby bdragon » Mon Jun 19, 2017 3:45 am

XnTriq wrote:Related: Upscaling / Enlarging

Should have thought it could not be that "original" as an idea.

But yes, since this is a batch scale image converter, so offering options to use a different algorithm to upscale and yet another more CPU-intensive one for very drastic upscaling (2x or more, when the pixels start showing) is still something that might turn useful.

User avatar
XnTriq
Moderator & Librarian
Posts: 5048
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Image Upscaling And Downscaling Algorythms

Postby XnTriq » Mon Jun 19, 2017 4:00 pm

bdragon wrote:Should have thought it could not be that "original" as an idea.

Your idea/suggestion to use different algorythms for up- and downscaling during a single batch operation is indeed new (AFAIK) and interesting (AFAIC)!

bdragon
Posts: 103
Joined: Mon May 01, 2017 8:06 am

Re: Image Upscaling And Downscaling Algorythms

Postby bdragon » Mon Jun 19, 2017 4:29 pm

Thanks :D

bdragon
Posts: 103
Joined: Mon May 01, 2017 8:06 am

Re: Image Upscaling And Downscaling Algorithms

Postby bdragon » Mon Jun 19, 2017 6:52 pm

uhm.... i just re-read.

If i have a filter that does "upscale with pixel scaling" theni apply the "resize" filter, then i'm "wasting" a lot of CPU time upscaling 90% (2700) of the pictures that need not be upscaled (or at least not that much).

Also keep in mind that while doing pixel upscaling is very good to "get details" where there are none, it can be done only on exact multiples of the original size.

To me the best option looks to be the following: there is a different "pixel upscale" filter which is distinct from the normal "resize" filter and does not ask you just for a given "upscaling multiple" (as most pixel upscaling programs do) but also for a "target size" and upscale only pictures that would (once upscaled) do the usual "fill", "fit" or "get near" the required size. as per normal resizing, only pixel resizing can only do exact multiple so to get the target desired resizing a second "normal resize" filter should be applied.

It is the best option as it makes the user interface less cluttered and in general it seems to get the point across with the "least work" to be done coding wise, as most of the stuff just has to be recycled. The user also has a nice little "pixel upscale" filter to tweak as he/she likes and maybe use either in conjuction with other resizes or just alone.

As for using different upscale and downscale the "least amount of work" would be to put an "upscale only" and "downscale only" option (i don't remember if it is already there) So if i apply the two filters close together, then the first filter will catch only stuff to upscale and use the algorythm i like to use for upscaling, and the second filter will just do downscaling and apply the algorythm i like for downscaling. And since they are close together, what is missed by the first gets taken by the second and everything is fine without doing loads and loads of code.

So the user just has to apply two filters, one for upscaling and one for downscaling, and it might be more flexible too, for whichever reason.

I am currently outside my house for work (and when i'll be back i'll probably just go to bed and forget about it).
Can anybody tell me if what i wrote is correct and sensible (and also check if what i just said is already there)?

bdragon
Posts: 103
Joined: Mon May 01, 2017 8:06 am

Re: Image Upscaling And Downscaling Algorithms

Postby bdragon » Tue Jun 20, 2017 5:19 pm

bdragon wrote:As for using different upscale and downscale the "least amount of work" would be to put an "upscale only" and "downscale only" option (i don't remember if it is already there) So if i apply the two filters close together, then the first filter will catch only stuff to upscale and use the algorythm i like to use for upscaling, and the second filter will just do downscaling and apply the algorythm i like for downscaling. And since they are close together, what is missed by the first gets taken by the second and everything is fine without doing loads and loads of code.

So the user just has to apply two filters, one for upscaling and one for downscaling, and it might be more flexible too, for whichever reason.

I am currently outside my house for work (and when i'll be back i'll probably just go to bed and forget about it).
Can anybody tell me if what i wrote is correct and sensible (and also check if what i just said is already there)?


And i was finally able to have some free time to check this and indeed it is already there.

Seems like i made a fuss over nothing.

Since we have already established that the pixel upscaling for extreme upscaling has already been issued as a request.

And since i have confirmed that indeed the procedure was already there, and also done in the best, most elegant, way i thought possible... consider this as either "fulfilled" "solved" or whatever. XD

bdragon
Posts: 103
Joined: Mon May 01, 2017 8:06 am

Re: Image Upscaling And Downscaling Algorithms

Postby bdragon » Fri Jul 07, 2017 10:28 pm

bdragon wrote:And also: if the image is going to be upscaled by a lot, would you allow to be able to choose along the usuals (like lanczos) something drastic like:
https://en.wikipedia.org/wiki/Pixel_art ... algorithms
or even
https://johanneskopf.de/publications/pi ... /pixel.pdf

Yes, i know: these are very edge cases, but if nobody ever asks if it would be appreciated, then nobody ever knows it might be needed or wanted.


a repository for a pixel scaler with source code: https://code.google.com/archive/p/2dima ... ads?page=1


Return to “XnConvert”

Who is online

Users browsing this forum: No registered users and 3 guests