![]() Registered Member ![]()
|
Hello, I am making art for a video-game. I have two windows when I make the art, one at 100% zoom, and one at 10% zoom, with the 10% zoom being how I plan the art to look in the game (I use different zooms because the scaling hides imperfections, allowing me to work much quicker).
However, I am running into the problem where, when I scale down the art to 10% of its original size, it doesn't look how it does when it's zoomed at 10% (it's uglier and has irregularities when compared to the zoomed version). Researching, I found that the zooming uses a scaling method by the name of "High Quality Filtering", which doesn't appear to be available as a scaling algorithm. I went through all of the available scaling algorithms, and none of them look as good as this "High Quality Filtering". Is there any way that I can apply this "High Quality Filtering" to the image when I scale it? Right now, I have to screenshot my desktop and crop out how it looks at 10% zoom to get the sprite that I want, which is sub-optimal. Thanks! |
![]() Registered Member ![]()
|
There may be more than one effect coming into play with your situation, besides scaling filtering.
If you adjust the view to 10% zoom and you have a high resolution display, the display may have enough screen-pixels to show those pixels of the image that would be removed or distorted by a 10% scaling operation. As such, the on-screen view at 10% zoom can not be a true representation of what you would get at 10% scaling. It all depends on the image sizes (as well as scaling and zoom view processes). However, you say you can screenshot the 10% view display and crop out an image of the size you want. As a matter of interest, can you tell us the size of your original 'working' image and the size of your required final image? |
![]() Registered Member ![]()
|
Hello. The original image size is 800x1800 px. It gets resized to 80x180 px. I don't think that my monitor's display resolution is making things appear off due to inspecting the pixels at like 500% zoom in my screenshots and noting the differences (shapes of things like mouths are different too due to how the algorithm handles its minification). I think it's due to the OpenGL scaling used for zooming not being available to use when scaling an image.
I looked into this "High Quality Filtering" some more. It uses mipmaps and a shader with OpenGL to produce this good-looking effect. I use OpenGL in my game engine, and upon seeing this, used the GL_LINEAR_MIPMAP_NEAREST filter as the GL_TEXTURE_MIN_FILTER. I applied it to the 800x1800 px image and scaled to 10% and my engine produced an image that is about 95% as good looking as the "High Quality Filtering". So, I suppose one workaround that I can do is to create all the art at 10x size and then create a tool that compiles these images into the size that I want using this OpenGL filter. To get exactly this "High Quality Filtering" for my art, I would have to adapt the Krita shader to my code, which I may or may not do in the future since GL_LINEAR_MIPMAP_NEAREST is really close. However, it would be really great if this filter could be applied to images directly in Krita. It is much more attractive than the other scaling options. |
![]() Registered Member ![]()
|
Thanks for the detailed and informative reply. The existing scaling filters, such as bilinear, bicubic, etc. are standard library scaling filters that are used in a various image processing applications, as I'm sure you're aware.
What you seem to need is for krita developers to create additional functionality or for someone to perhaps create a plugin. The Krita Extension forum: viewforum.php?f=156 would be the best place to ask about this and get developer and plugin author comments and feedback. Perhaps you could work with someone on this? |
![]() Registered Member ![]()
|
I ended up developing my engine a little so that it would take a source directory of images (the 10x size ones) and apply the appropriate OpenGL filter, compiling them to my game assets folder. I use the Krita filter as reference for the live view, since it's close enough. I'm going to see if I can rig my engine to give me a live view of the art as well, using the "mergedimage.png" file in the .kra structure, so I'll know how it'll look in my engine 100% as I'm doing the art.
Unfortunately, I do not have as much free time as I'd like, so I wouldn't be able to help develop a plugin for this functionality. Thanks for answering! |
![]() KDE Developer ![]()
|
That might be a stupid question, but have you tried "Nearest Neighbour" algorithm in Krita? When scaling, you can select this algorithm and this one behaves differently than most others. And the OpenGL filter you mentioned: GL_LINEAR_MIPMAP_NEAREST is called in a way that suggest at least similar algorithm used. The nearest neighbour algorithm is an algorithm that is mostly used with Pixel Art, since when you scale with it, it doesn't distort any colors and if you for example upscale 4x the result is exactly the same picture but with every pixel replaced by 16 pixels with the same color.
Also note that 800x1800 -> 80x180 means that the resulting picture is 1% of the original one, not 10%. It doesn't really matter since the zoom uses the same 1D (instead of 2D) values (so it says it's 10%), but it is worth noting since in your resulting image 1 pixel is made from as many as 100 pixels from the original image. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]