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.


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


Alfred online2long.gif
Affinity Designer/Photo/Publisher 1.7.3.481 • Windows 10 Home (4th gen Core i3 CPU)
Affinity Photo for iPad 1.7.3.155 • Designer for iPad 1.7.3.1 • iPadOS 13.3 (iPad Air 2)

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.


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

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

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.