Page 1 of 1
Warp - Bilinear: Edge Artifact
Posted: June 24th, 2019, 6:55 pm
by jfoster
![WarpEdgeProb1.jpg](./download/file.php?id=1203)
- WarpEdgeProb1.jpg (12.96 KiB) Viewed 4040 times
![WarpEdgeProb2.jpg](./download/file.php?id=1204)
- WarpEdgeProb2.jpg (11.36 KiB) Viewed 4040 times
![WarpEdgeProb3.jpg](./download/file.php?id=1205)
- WarpEdgeProb3.jpg (2.41 KiB) Viewed 4040 times
The top image was warped left to stretch the image left so that only the blue remained across the frame. Notice the right edge, which should not have been affected by the warp transformation (closeup in third image).
Jeff
Re: Warp - Bilinear: Edge Artifact
Posted: June 24th, 2019, 7:31 pm
by jsachs
The Warp transformation necessarily resamples the input image so it will not in general reproduce the kind of edges in your example. The area outside of the image is taken as black, so you get a dark blue when an edge is resampled. If the entire warp region is inside the blue you should not get dark edge pixels.
Re: Warp - Bilinear: Edge Artifact
Posted: June 24th, 2019, 8:15 pm
by jfoster
Never experienced that in PWP 7 and have done this very often.
Sometimes I will crop a portion of an image, warp it, and then composite the warped partial image back to the original to yield an image with a portion of it transformed to what I want in the final composition. When I do this, I initially mirror/transpose the image so that the cropped/warped image will easily composite back with original image - both images sharing a common lower left coordinate origin. (Bilinear warp, rather than perspective warp, has in the past at least, kept the non-transformed edges unaffected and in-register.)
On this image, I first warped one side of the cropped image, to extend the sky so the image would ultimately fit into an aspect ratio I needed. It composited back in-register without any edge artifacts. I then mirrored the image, cropped the edge again, and applied the warp transformation to this second cropped portion of the image and this time it produced the edge artifact shown here. This issue was not seen the first time I warped a portion of this image, and something I've never seen in PWP 7.
Jeff
Re: Warp - Bilinear: Edge Artifact
Posted: June 24th, 2019, 9:13 pm
by jsachs
The code for warp is pretty much identical to version 7 so I would be surprised if there were any difference.
The edge effect should only occur if the outline of the warp region falls on or within less than a pixel of the edge of the image (or the edge of the object you are warping within the image)
Re: Warp - Bilinear: Edge Artifact
Posted: June 24th, 2019, 9:33 pm
by jfoster
Looking back, I've been doing this trick of cropping a portion of the image, warping it, and compositing it back to the original without any edge artifacts on prior PWP releases since 2009. It worked without an edge artifact today on an image 1 out of 2 times with PWP 8. I may have been lucky all these years, but I'm leery.
Re: Warp - Bilinear: Edge Artifact
Posted: June 25th, 2019, 6:58 am
by jfoster
I tried this a number of times with PWP 7 and 8 and could not reproduce the edge artifact - I was able to composite the warped portion of the image back onto the original in-register at the edges. What I did find that surprised me and I'm guessing may not be expected behavior is that the geometry transformations (crop and warp at least) sometimes allow their parameters to be changed by interacting with the preview image.
For example, sometimes the mouse pointer becomes an arrow when hovering over the edge of the preview image and allowing the transformation to affected by dragging on the edge of the preview image.
Re: Warp - Bilinear: Edge Artifact
Posted: June 25th, 2019, 7:31 am
by jsachs
I tracked down the problem with Add Border which was related to antialiasing of the new border shape options. Since a rectangular border with 0% softness is by far the most common case, I added code for the next release to check for this case and produce a clean edge all the way around. With other shapes you may still see some edge softness.
As long as you hold the mouse button down, you can drag the corners, edges or interior of the warp quadrilateral or crop rectangle outside the input image area. Once you let go of the mouse button however you should not be able to click and drag on anything outside the input image area. If a corner or edge is out of view or if you want to drag it outside the input image, you can zoom the input image out.