Jump to content

"Smooth" Re-sizement

Recommended Posts


I am member of the Re-Volt Community and using Paint.NET to do all kinds of textures. Recently a new guy appeared up and created a new patch that makes me and other track- and car makers use 512x512 textures for our stuff. Now, the only problem we currently seem to have is that there already is 2000 tracks and cars available on our community site, all using the previous standard dimensions, 256x256 (bmp).

We've been working hard on figuring out how to re-size these old textures to the new 512x512 standard, without creating black borders (the alpha, 0 0 0, is build-in to the textures) around our textures. Until now we are separating the black layer from the rest of the textures, but the fact is that using bilinear and bicubic re-size parameters, overshootings will still get caused.

Today I managed manually to split up all textures from each other and then copy the original textures to a 512x512 bitmap to re-size them up :MoveTool: the double size using the smooth parameter. Below you'll see a compare between a bicubic re-sizement (0 0 0 has been re-sized using nearest neighbor) and a smooth re-sizement, where each object still has got it's shape.



As we got huge amounts of level- and car-textures we need to do a similar re-sizement using either a program created for that or an easier progress in Paint.NET. If any information could tell us, which parameter "Smooth" uses to re-size, that would be great. Any other suggestion into how you can re-size and keep the shape fastly would also be appreciated.

Thank you for reading.

Link to comment
Share on other sites

"Smooth" is just a bilinear resampling (triangle filter).

In order to do the math correctly, however, you need to work with the pixel centers. Basically, add 0.5 to the dstX/dstY, then translate to the srcX/srcY, then subtract 0.5. Otherwise you'll have all sorts of confusing issues with "black borders" and no amount of fudging or kludges will really fix it all.

for (int dstY = 0; dstY {
   double srcY = (((dstY + 0.5) * srcHeight) / dstHeight) - 0.5;
   for (int dstX = 0; dstX     {
       double srcX = (((dstX + 0.5) * srcWidth) / dstWidth) - 0.5;
       ... normal bilinear sampling kernel goes here ...

Also, the Move Selected Pixels tool has some fixes coming in v3.5.2. So does Image->Resize.

As far as automation or batch processing, that isn't currently possible with Paint.NET.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...