Jump to content
WnSoft Forums

Masks And Jagged Edges


xahu34

Recommended Posts

I don't know if this problem has been discussed before: If you use a sharp-edged rectangular mask in order to crop part of an image or a video, you will see jagged edges in case of rotations (normal or 3D). See also the attached simple project. This could be regarded as a bug, or, it would nice to see here an anti-aliasing option.

Regards,

Xaver

Jaggies.zip

Link to comment
Share on other sites

Hi Xaver,

I don't think the mask has any relationship to the problem. If you remove the mask entirely and rotate that image there is still jagged edges.

Best regards,

Lin

Hi Lin,

This is not true. If you just rotate the image, you may choose the option "Edge antialiasing". In this case (at least in the full-screen preview), the edges look much better. For the cropped (masked) area, anti-aliasing seems to be missing.

Best regards,

Xaver

Link to comment
Share on other sites

Hi Xaver,

I agree with you.

I think that if you choice 0,5% (even 0,4%) for the "Width of blur" AND for the "Corner Radius" of your mask, it'll be OK

Best regards

Jean-Cyprien

PS Just 0.4% for the Corner Radius is sufficient, and it's quite invisible.

Link to comment
Share on other sites

Hi Jean,

If you resize the image by distorting the XY axis with the shift key, make it the same size in dimensions as the image inside the mask and rotate it with or without the mask, I see the same aliasing. The mask, at least on my system, has no influence on the aliasing unless you use a bit of blur and then it hides the aliasing. I'm just not seeing that the aliasing is in any way related to the masking.

Best regards,

Lin

Link to comment
Share on other sites

Hi Jean,

I'll have to work with it some more. It looks as if the aliasing might be the mask rectangle rather than the image. Xaver is rotating the mask container rather than the image inside a mask so that may have some relationship to the problem. I'm using a CRT so it may not be as sensitive for display of aliasing as an LCD display.

I can't see that the anti-aliasing feature is having any effect when checked regardless of a mask. Perhaps the problem is that the anti-aliasing itself is just not working?

Best regards,

Lin

Hi Lin,

When you are working, and selecting the SD_blur file, you could believe it's the same thing. But if the file is not selected, it's quite different for me. At least, with my screen !?!

Best regards,

Jean-Cyprien

Link to comment
Share on other sites

Hi Lin,

I've tried to rotate the picture inside the container, not to rotate the container. To have the same movement as those of Xaver, the mask itselk has to rotate too, of course.

The result is the same : bad aliasing.

CRT vs LCD perhaps you've something there ? See my crop "screen" to see the difference with and without the mask.

(But now it's the bed'time ! )

Best regards,

Jean-Cyprien

Jaggies3.pt.zip

Link to comment
Share on other sites

In my opinion, the situation is as follows:

  1. For images you have a choice: Edges are rendered with anti-aliasing or without. In the first case you do not see jaggies in case of image rotation, in the second case you will see them.
  2. For masks you do not have a choice, and edges of built-in masks seem to be rendered without anti-aliasing. Therefore sharp edges of the mask will produce jaggies in case of mask rotation, provided that these edges are inside the associated image. The image itself may not rotate at all.

Regards,

Xaver

Link to comment
Share on other sites

I made an additional test with rectangular external masks.

  1. If you take as your mask just a white image, the situation is as bad as in case of a built-in sharp-edged rectangle.
  2. If you choose as your mask a black image with a white rectangle inside, then mask rotations look smooth :)

Regards,

Xaver

Link to comment
Share on other sites

Hi Xaver,

I agree with you.

I think that if you choice 0,5% (even 0,4%) for the "Width of blur" AND for the "Corner Radius" of your mask, it'll be OK

Best regards

Jean-Cyprien

PS Just 0.4% for the Corner Radius is sufficient, and it's quite invisible.

Hi Jean-Cyprien,

The "Amitié Franco-Allemande" seems to go well (joke)

Thank you for the hint!

Best regards,

Xaver

Link to comment
Share on other sites

Xaver,

You raised a good question. Jean-Cyprien suggested right solution for mask antiliasing.

There couldn't not be a separate antialiasing option for a Mask object, because maska can have any shapes. Our edge antialiasing algorithm works only for a rectangular form.

Link to comment
Share on other sites

Thank you Xaver, but I think that your hint is MORE interesting than mine.

I've made different tests with an external mask as you've said, with interesting results.

With only a white - rectangular - part : with jpeg, or png8 or png24 : BAD aliasing.

With a black part behind the white part : with jpeg, png8 or png24 : GOOD !

With a transparent part behind the white part : png8 or png24 : GOOD !

(The results with a non-rectangular white part are not so simple)

Thank you Igor for your clarification.

Best regards to all of you,

Jean-Cyprien

Link to comment
Share on other sites

...

I think that if you choice 0,5% (even 0,4%) for the "Width of blur" AND for the "Corner Radius" of your mask, it'll be OK

...

Just a short amendment to Jean-Cyprien's suggestion. The value of 0.4% seems to work well for an in-built mask of size about 512x512 (maximum size). If you choose smaller values for the mask's size you will have to choose greater values for Width of blur and Corner radius.

Regards,

Xaver

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