Jump to content
VectorCat

Slice is bigger than my object

Recommended Posts

I have a very simple object: an envelop (icon) - just a rectangle with a few lines to indicate the flaps.

Nothing protrudes beyond the rectangle of the envelop, yet I’m told the slice is 1 pixel bigger in each dimension than it ought to be!

I know that if I’m over even just a wee bit, it’ll kick things up to the next whole pixel, but how can I conform with AD’s understanding of whether I am in fact bigger than I think it is?

my dimensions are even numbers and my positioning is to-the-pixel.

Eyeballing it doesn’t seem to be quite the acid test...

thank you!


 2012 Mac Book Pro 12”, 8GB RAM, Mojave  |  2017 iPad Pro 12.9” 256GB, iOS 12.4

Share this post


Link to post
Share on other sites

the strokes are all set to draw inside; IOW, the strokes don’t hang outside the perimeter of the shape.

thank you!


 2012 Mac Book Pro 12”, 8GB RAM, Mojave  |  2017 iPad Pro 12.9” 256GB, iOS 12.4

Share this post


Link to post
Share on other sites

In the Transform Studio in the Vector Persona, select the rectangle. Tap on the top left anchor point & note the X & Y position values for it. (If the document is set to use something other than pixels, tap on the value to open the calculator display, & tap on the units below the value to temporarily change it to show pixels.)

I suspect you will find that the top left X & Y position values are not an integer number of pixels & most likely have a 0.5 pixel offset -- IOW, the rectangle is not pixel-aligned. If so, change them to integer values & export your slice again. Are the 'extra' pixels still there?


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites

In vector persona, with the object selected, the position x and y of the top left point/corner, is on an integer coordinate, AND the dimensions of the object are integer values.

Ad still, the slice dimensions have “added” pixels.

I am soundly baffled!

:(


 2012 Mac Book Pro 12”, 8GB RAM, Mojave  |  2017 iPad Pro 12.9” 256GB, iOS 12.4

Share this post


Link to post
Share on other sites
2 minutes ago, VectorCat said:

I am soundly baffled!

Unbaffling will probably involve uploading the project file to the forum so someone can have a look at it


Due to the fact that Boris Johnson is now our Prime Minister, punctuation, spelling and grammar will never be worried about ever again.  We now have far bigger problems to be concerned about.

Share this post


Link to post
Share on other sites

I think you’re right, but...just to make sure I’ve exhausted all possibilities, I should ensure that all size/position values are integer, and if so, the slice size should be integer values as well, yes?

Is there any other bit that a newbie could overlook?

I have successfully created correct-size slice on the desktop version of Designer, but as I recall, it was a bit tricky there, too.


Thanks!


 2012 Mac Book Pro 12”, 8GB RAM, Mojave  |  2017 iPad Pro 12.9” 256GB, iOS 12.4

Share this post


Link to post
Share on other sites
3 hours ago, VectorCat said:

I’m taking your suggestion to upload, and can’t wait to learn what my misunderstanding is.

If you change the document units to pixels & check each of the 2 diagonal curves in the Transform Studio, you will see that they are almost but not quite pixel-aligned. If you tweak their positions slightly so that their lower edge nodes align exactly on a whole-pixel boundary, the extra pixels should be eliminated.

problem AD slice size tweaked.afdesign


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites
1 hour ago, owenr said:

Here is a screenshot of the document units set to pixels and a diagonal recoloured blue to make it even more clear that the diagonal is inside the perimeter of the whole group.

To be clear, I am not saying there is no bug. It is just that I noticed the stroke width of the left diagonal is ~7.9654 px & its lower left node's Y coordinate is ~756.614 px. Similarly, the other diagonal's width is ~7.9275 px & lower right node's Y coordinate is ~757.0043 px. The Y coordinate of the base of the rectangle is 760 px, so with the diagonals set to use butt caps as they are, I agree that the diagonals should be within the perimeter.

All I am saying is for whatever reason moving the Y coordinate of those 2 nodes to 756 px exactly & moving them inward 1 px (to X coordinates of 364 px & 656 px respectively) eliminates the extra pixels in the slice:

1353435018_2slices.jpg.88e823c9a6b71db63d0bf430b6291413.jpg


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites

This discussion is pretty interesting.. Yes, tucking the smaller parts of the envelope under the main rectangle..not grouping but making them...children?  < that results in a slice of integer dimensions.

what I don’t get - other than it’s an arguable bug - is why the separate parts sliced together make a slice larger than it ought to be?

Is it because of the way AD “sees” the various parts?  Either a point or a line or a shape is within the perimeter, or it isn’t.

...unless it ain’t that cut-and-dried in AD’s eyes

 

Anyhoo, I’ve learned a functional workaround that’ll do until the bug is put in a jar and let out the back door.

And I thank you for the information that let my work move forward! I’m lovin’ using AD for iPad!!!

;-)


 2012 Mac Book Pro 12”, 8GB RAM, Mojave  |  2017 iPad Pro 12.9” 256GB, iOS 12.4

Share this post


Link to post
Share on other sites

There is one other issue...that envelop as a vector object, measures 150px by 100px but as a *slice* despite being 1x, measures 300px by 200px

Could this also be buggish behavior? 


 2012 Mac Book Pro 12”, 8GB RAM, Mojave  |  2017 iPad Pro 12.9” 256GB, iOS 12.4

Share this post


Link to post
Share on other sites
33 minutes ago, VectorCat said:

There is one other issue...that envelop as a vector object, measures 150px by 100px but as a *slice* despite being 1x, measures 300px by 200px

It is easy to overlook but it is 150 pt x 100 pt (points, not pixels). If you change the document units to pixels, you will see that it is 300 px x 200 px. I assume the '2x' factor is because you set the document to 144 dpi.


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites

Right you are, Sir...

Would you recommend working at 300dpi for producing web-only graphics, or 72 or 96?

 

Thank you!


 2012 Mac Book Pro 12”, 8GB RAM, Mojave  |  2017 iPad Pro 12.9” 256GB, iOS 12.4

Share this post


Link to post
Share on other sites

I'm not so sure it is a bug

If you switch to pixel measurements you will find x & y values not on whole pixels

Plus one curve is 106px wide and the other one is 105px wide, so the design is not symmetrically correct.

If you tidy up the above items (see attached) the design exports the slice as you would expect

 

fixed2.afdesign


Due to the fact that Boris Johnson is now our Prime Minister, punctuation, spelling and grammar will never be worried about ever again.  We now have far bigger problems to be concerned about.

Share this post


Link to post
Share on other sites
4 hours ago, VectorCat said:

Would you recommend working at 300dpi for producing web-only graphics, or 72 or 96?

For rasterized files (like JPEGs or PNGs) derived from vector shapes intended for use only on web pages, dpi is irrelevant, as explained in the Understanding DPI video tutorial. (The video is for Affinity Photo but it also applies to Affinity Designer.) The pixel resolution (its dimensions in pixels) is the important part, which is why for web-only projects I suggest using pixels rather than points as the document units.

 


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites
On 8/21/2018 at 7:31 AM, owenr said:

A bug. The slice generator is oversizing the bounding rectangle of each of the two diagonal line Curve objects.

If you nest them inside the Rectangle object, you'll get the correct size of slice and export.

 

So, there are cases where nesting causes the nested item to be clipped by the parent..is there a way to have this not happen?

 

thank you!


 2012 Mac Book Pro 12”, 8GB RAM, Mojave  |  2017 iPad Pro 12.9” 256GB, iOS 12.4

Share this post


Link to post
Share on other sites
19 hours ago, owenr said:

Below is the pixel view of the bottom left corner of the group, without any moving of nodes but with a diagonal line changed to black. The diagonal line's black stroke does not cover pixels outside of the grey-stroked rectangle. The pixel row below the grey and the pixel column to the left of the grey are pure white, but the slicer incorrectly considers the diagonal line's stroke to extend into the white row and column.

2131081190_slicebugpixelview.thumb.png.fe7fb24b1712597d47a261c1df7557c5.png

 

beautifully stated and demonstrated.

Is there a place for us to register such issues with the AD team? What are people doing meanwhile? Are they exporting their slices, then correcting the size of the resulting jpg, gif or png in a raster editor?

durn shame that an otherwise elegant workflow now requires help from an outside app.


 2012 Mac Book Pro 12”, 8GB RAM, Mojave  |  2017 iPad Pro 12.9” 256GB, iOS 12.4

Share this post


Link to post
Share on other sites
17 hours ago, owenr said:

No, it's the the correct result and the reason that clip-nesting has become a feature of vector graphics. Preventing the clipping is simply a matter of not nesting.

Maybe I'm misunderstanding your question.

 

No, owenr..you understand me just fine. I need to explain my question better.

Clip-nesting was suggested by another poster for my envelope problem, and it worked for that, but it doesn’t work for everything. 

I’m trying to develop graphics for a web project and this issue is stalling my workflow. 

I need to avoid the scenario of creating objects in AD, but having to fix the exported files in another app. I’ve done a few more experiments creating real graphics which I will use, and exporting them as slices, so I’m getting more confident that I understand what AD needs for me to get what I want. Between job and home chores, I have only so much time, as do we all.

 

thank you!


 2012 Mac Book Pro 12”, 8GB RAM, Mojave  |  2017 iPad Pro 12.9” 256GB, iOS 12.4

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

These are the Terms of Use you will be asked to agree to if you join the forum. | 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.