Jump to content
Mike089123

keeping pixel dimensions in integer values when scaling

Recommended Posts

I have the decimal place for unit types on pixel set to 0, and snapping and move by whole pixel on, yet when I rescale images they will not be integer values. Even when changing the width and height to an integer value, and rescaling, it will not be an integer value anymore. This makes it a pain to create an artboard from selection since it keeps adding extra pixels to the sides, as well as adding more pixels to the dimensions when exporting.

Share this post


Link to post
Share on other sites

The decimal places set in Preferences are just for display purposes -- internally, the app always uses the maximum precision possible. "Move by whole pixels" will do exactly that, so for example, if the width is currently 800.2 px dragging a handle will be constrained to values of 799.2 px or 801.2 px & so on.

 

Also, if the aspect ratio lock is on in the Transform panel, changing width or height may force the other setting to a fractional value to maintain that ratio.

Share this post


Link to post
Share on other sites
23 hours ago, R C-R said:

The decimal places set in Preferences are just for display purposes -- internally, the app always uses the maximum precision possible. "Move by whole pixels" will do exactly that, so for example, if the width is currently 800.2 px dragging a handle will be constrained to values of 799.2 px or 801.2 px & so on.

 

Also, if the aspect ratio lock is on in the Transform panel, changing width or height may force the other setting to a fractional value to maintain that ratio.

So how do you scale while keeping integer values?

Share this post


Link to post
Share on other sites
29 minutes ago, Mike018 said:

So how do you scale while keeping integer values?

 

In general, you can’t scale an object in a single operation if you want to keep integer values for its dimensions and maintain the aspect ratio at the same time. For example, if you start with an 8" by 5" rectangle and you halve the long side, that length will become 4", but if the aspect ratio is locked the short side will become 2.5", so you would need to unlock the aspect ratio and truncate or round that value.

Share this post


Link to post
Share on other sites
36 minutes ago, Mike018 said:

So how do you scale while keeping integer values?

There are several things you need to consider for this. As @Alfred said, the most obvious is the mathematics of aspect ratios & scale factors. If multiplying each dimension by the same scale factor on a calculator does not yield integer values, then it won't in Affinity Designer either.

 

Beyond that, you also have to consider stroke widths & their alignment:

5a86b87430957_strokealignment.png.8faef5183f904a28b75d39f58344a0b6.png

All 3 shapes are 10 X 10 px squares, precisely aligned on integer pixel dimensions. But the left one will never align on integer values because its stroke is an odd integer value & it is center aligned.

Share this post


Link to post
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.


×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. 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.