Jump to content

Resizing or rotating destroys color data on zero-alpha pixels


frio

Recommended Posts

I often work with game engine textures where the color data even on fully transparent pixels is important. If you resize or rotate something, all pixels become #00000000 instead of #00rrggbb. Not a pressingly big issue since generally it's fine to scale from high-resolution work version to the final size first, then apply final alphas, but it has caught me on a couple occasions.

 

I checked the following:

  • image resize always produces #00000000 regardless of chosen scaling method
  • layer zoom/rotate, even at 90 degree angles, produces #00000000
  • image flip/turn (counter)clockwise or 180 work correctly
  • layer flip/turn 180 work correctly
  • selection resize/rotate produce #00000000 with bilinear/bicubic, work correctly with nearest neighbor
  • selection moving works correctly with all modes

 

Edit to add: Windows 7, paint.net version 4.2.14 if those make any difference

Edited by frio
Link to comment
Share on other sites

This happens because of the math that's involved in alpha blending and compositing. It's unavoidable for the most part, except for simple cases like when Nearest Neighbor sampling is used.

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

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

forumSig_bmwE60.jpg

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.

Guest
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...