Jump to content
You must now use your email address to sign in [click for more info] ×

AP wrong size export problem (BUG?)


Recommended Posts

MEB,

 

I understand how it works. But with a selection I would argue that the content's X/Y coordinates relative to a page or artboard should not matter. The selection, in this case, is of whole pixel values. Like in XDP, this ought to be possible.

Link to comment
Share on other sites

I understand how it works. But with a selection I would argue that the content's X/Y coordinates relative to a page or artboard should not matter. The selection, in this case, is of whole pixel values. Like in XDP, this ought to be possible.

The selection is being forced in whole pixel values, just not the expected ones. The reason is the selection is not aligned on pixel boundaries. (Note the fractional x & y values in the Transform panel.)

 

Consider a very simplified example of a 2x2 px selection of a 3x3 px document. If the selection begins ½ pixel down & right of the document's upper left corner, every exported pixel would somehow have to represent the resampled value of four of the document's original pixels. Image the document is an alternating black & white checkerboard pixel pattern -- the result would be four equally gray pixels -- generally not what users would want.

 

The solution is to align the selection on pixels boundaries before export.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

The selection is being forced in whole pixel values, just not the expected ones. The reason is the selection is not aligned on pixel boundaries. (Note the fractional x & y values in the Transform panel.)

 

Consider a very simplified example of a 2x2 px selection of a 3x3 px document. If the selection begins ½ pixel down & right of the document's upper left corner, every exported pixel would somehow have to represent the resampled value of four of the document's original pixels. Image the document is an alternating black & white checkerboard pixel pattern -- the result would be four equally gray pixels -- generally not what users would want.

 

The solution is to align the selection on pixels boundaries before export.

 

Did I mention I know how it works?

 

What you describe is simply that, how it works.

 

Have you asked yourself if it really has to work that way with a selection?

 

post-255-0-95082900-1475194854_thumb.png

 

post-255-0-09490000-1475194867_thumb.png

 

It really doesn't have to (or, shouldn't have to). I fully understand and accept that if a selection itself is off of whole pixels, anti-aliasing has to occur. But a page or artboard that is itself on the pixel grid, its contents--or the selected contents that are whole pixels--should not be forced into a concept of a pixel grid.

 

So what is the rational of forcing a selection to align to a pixel grid? 

Link to comment
Share on other sites

So what is the rational of forcing a selection to align to a pixel grid?

 

How can you create a JPEG that is not forced into alignment with a pixel grid?

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

How can you create a JPEG that is not forced into alignment with a pixel grid?

 

Did you look at the screen shots from XDP? If the object has whole pixels, why should it need aligned to a pixel grid?

 

I understand it is a requirement in AD. But why should it be? It is a selection and should be exported at its dimensions. If a selection is not whole pixels, then sure, round the selection to the nearest whole pixels. But even this is not / should not be dependent upon a selection's X/Y location on the page/artboard. The rounding of pixels of a selection should only be dependent upon the selection's dimensions.

 

So while this may not be a bug of AD's, it is certainly not expected on my part.

Link to comment
Share on other sites

  • Staff

Hi Mike W,

I see your point, but i don't think we are picking the selected object individually here. It's being being considered in the context of the whole document. If you look at the Area dropdown we offer options to include or not the background. If we do include it, it's obvious why the X, Y coordinates are important to get the correct size; if we choose to not include the background the exact same area is simply being "replaced" (i believe) with transparency (and not discarded as you are suggesting) and so the X,Y coordinates still have influence on the exported size.

In other words, i believe the exported file is always being composited with the background no matter if it's filled with "content" or transparency, but i may be wrong here. Only Matt or Andy can give you a definite answer on this.

Link to comment
Share on other sites

MEB,

 

Here's the thing. I just exported a circle and triangle group to PNG format that was 900 x 836 pixels, but it was sitting off of whole pixels both in the X/Y coordinates. Using the selection option and without the background in export, AD of course rounds the export selection. In this case, Y was rounded down, X was rounded up. However, I could then uncheck the lock, set the export to the actual size of the selection, then export. Which I did.

 

I then moved this group to whole pixel values. I then recolored the objects. I then used Export again. Also without background. AD then used the values of the group's dimensions. I exported this image also.

 

I loaded both images into an image editor and overlaid one on the other. They are pixel perfect (even swapped the order of layers to make sure).

 

I therefore do not believe it is necessary to round up/down an image export based upon its location X/Y coordinates if the the image is whole pixels in the first place. This is why XDP can do this for a selection--it does not take into account the X/Y information on a selection and only rounds if the pixel dimensions are not whole pixels.

 

Mike

Link to comment
Share on other sites

If a selection is not whole pixels, then sure, round the selection to the nearest whole pixels.

How can a selection that does not start (or end) on a pixel boundary & includes raster objects be composed only of whole pixels?

 

Raster objects are inherently composed entirely of whole pixels -- AD & AP can display them anywhere on the canvas but that is only because it maps the object's pixels to best fit the display's pixels, anti-aliasing or interpolating as needed, but that does not change the pixel-aligned nature of the raster object itself.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

R C-R, you can add things that are not pertinent to the thread all ya want...but please try to understand the issue.

 

The issue is that if the extents of a selection are of whole pixels, as per the OP's post and my illustrations, then AD does not need to round off the pixels of the extents just because the selection is not placed on the page/artboard on whole pixel values.

 

I fully expect that anything in the interior of the selection would be anti-aliased, including vector or bitmap elements. What I do not expect is that the boundary be rounded to a whole pixel value if the selection boundary are whole pixel dimensions.

 

I've shown that it can be done by manually typing in the same export dimensions of the selection. Therefore I do not know why Serif should not disregard the X/Y page coordinates of a selection. All that should matter as regards rounding to whole pixels is whether the selection is of whole pixel dimensions and, if not, round the X/Y as required.

Link to comment
Share on other sites

How do you know that uncle808us' selection in the first post consists only of whole pixels? Note that he is using Affinity Photo, not Affinity Designer (as indicated by the live filter & group icons in the bottom of the Layers panel).

 

EDIT: I think we may be talking about two different things, in part because I suspect we are talking about two different apps. In Affinity Photo, even vector shapes like ellipses are raster objects. Once drawn, you can use the "Convert to curves" button & the Node tool to change their shapes like you can with vector objects in Affinity Designer, but once you deselect their layer, they revert to anti-aliased raster objects. (If you use the "Rasterize..." option from the Layers menu or the context menu popup in the Layers panel, you cannot use the "Convert to curves" button to edit their nodes because the shape has been "baked" into an anti-aliased raster object.)

 

So in Affinity Photo, for all practical purposes everything is a raster object, at least for exporting to a raster-only format like JPEG, GIF, or PNG. If your selection contains raster objects not aligned on pixel boundaries, rounding will occur because otherwise you will clip the edges where anti-aliasing occurs.

 

It is a little different in Affinity Designer. As long as your selection consists only of vector objects, it doesn't matter if they are aligned on pixel boundaries or not (because they are resolution-independent vector shapes). No rounding occurs on export. But, if you rasterize any of the vector objects in your selection, or it contains rasterized objects to begin with, it is just like Affinity Photo -- for the same reason rounding occurs unless everything is aligned on pixel boundaries.

 

You can try this in AD. Create a small document, say 200 px by 200 px & draw two ellipses in it exactly 30 by 40 px. Set one of them to whole number x & y origin points & the other to fractional ones. Select each of them in turn & in the export window set the Area value to either selection with or without background. Note that no rounding occurs for either of them. They are vectors so the origin doesn't matter.

 

Now go back to the document, rasterize each shape, & repeat the export. Note that rounding does not occur for the shape aligned on whole number x & y values but it does for the other.

Edited by R C-R

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

R C-R, whether AP or AD, it's no matter. The OP's screen shot displays the selection as being whole pixels.

The screen shot shows that the "PromotionalImage" group layer has been selected & its origin x & y coordinates are displaying fractional pixel values. That means unless every layer in the group is a vector object at least one layer in that group is not aligned on a pixel boundary & cannot consist only of whole pixels. Since we cannot tell if that is true from the screen shot, there is no way to know what those layers contain except from the rounding shown, which indicates that at least one layer is a raster object not aligned on a pixel boundary.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

The selection consists of while pixels. The selection is 900 px X 400 px.

 

AP/AD should not take into account of the X/Y coordinates.

 

The selection during export can have the 900 px X 400 px typed in and the export is then 900 px X 400 px regardless of the X/Y coordinates. At least in AD, which appears to me to behave identically if I recreate the file.

 

Mike

Link to comment
Share on other sites

Mike, maybe this screen shot will help explain what happens in Affinity Photo when layers are not aligned on pixel boundaries. I created a 5 point star in AP & moved it to the fractional x & y coordinates shown in the Transform panel. In this zoomed in view, it is evident that even though the w & h dimensions are whole numbers & the selection is a shape, because AP rasterizes & anti-aliases it, not all of its pixels fit completely & exactly into its w & h dimensions. Thus, they are not whole pixels with respect to the selection's dimensions.

 

So unless the app rounds the dimensions of this selection on export, there will be pixels that will have to be discarded.

 

post-3524-0-11489000-1475259147_thumb.png

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

AP/AD should not take into account of the X/Y coordinates.

As simply as I can put it, for rasterized objects there is no way to avoid doing that. Those coordinates define where pixels begin & end; they cannot be ignored.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

As simply as I can put it, have you tried to do it as I described it?

 

That is, create the same size rectangle. Make sure the X/Y coordinates are a partial pixel. Select the rectangle. Go to export a png file. Set the export for selection. The info will show rounding. Type in the same pixel dimensions as the rectangle. Now export and let me know what size the export is.

Link to comment
Share on other sites

As simply as I can put it, have you tried to do it as I described it?

 

That is, create the same size rectangle. Make sure the X/Y coordinates are a partial pixel. Select the rectangle. Go to export a png file. Set the export for selection. The info will show rounding. Type in the same pixel dimensions as the rectangle. Now export and let me know what size the export is.

A rectangle is not a raster object. Rasterize it as I described & repeat your experiment.

 

I do not know what you are doing differently but if I avoid including anything in the selection that is rasterized, it doesn't matter what the x/y coordinates are -- no rounding occurs. Are you saying you get different results if you are careful not to include anything in the selection that will be rasterized on export (including most effects, gradients, etc.)?

 

If so, what version of AD (or AP, it is the same in this respect) are you using?

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

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.
Note: Your post will require moderator approval before it will be visible.

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.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.