Jump to content

Recommended Posts

Question 1:
I need a macro for the image width of photos, the height should grow proportionally. I can't handle this.

Question 2:
I need macros for frames (Rectangular Selection Tool) in certain sizes, e.g. 500 x 600 px. I don't mean the picture size just the selection frame.

Question 3:
In Photoshop it is possible to modify and edit actions. For example, I could delete the image height for question 1. I can't find a way in Photo, did I overlook anything?

Share this post


Link to post
Share on other sites

iMac 27" Late 2015 Fully Loaded, iMac 27" Mid 2011 both running High Sierra 10.13.6 - Affinity Designer/Photo, Publisher Beta 1.7.0.140, Illustrator CC, Inkscape, Blender, Sketchup, Pepakura Designer, MTC, Pixelmator & Pixelmator Pro + more... XP-Pen Artist-22E, - iPad Pro 12.9 B|  

Affinity Help - Affinity Desktop Tutorials Instagram & Flickr - Affinity Live 19th June 2019

Share this post


Link to post
Share on other sites

I'm sorry, this isn't working. There is no possibility to save a macro only with the image- or selection width. When recording a macro, I change the image width, the image height would also changes proportinally and is recorded in the macro. This is problematic because photos exist in different ratios, 3:2, 4:3, etc. So, you will not get a proportional result with other than the recorded ratio. Therefore you need to be able to edit macros, e.g. to remove the height. My macros has no Settings, so I can't edit anything.

Tools which I really miss in Photo: Rectangular Selection Tool presets:
Normal, Fixed Ratio, Fixed Size (like the Crop Tool). That will make the work of web designers much easier. We constantly have to create identical image formats for projects, hero images, gallery photos, photos, etc. which are repeated hundreds of times.
The Crop Tool allows to specify width and height, why not the selection tool? Web isn't desktop publishing, we don't have a picture frame in which we can place pictures. We have exact sizes.

Share this post


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

There is no possibility to save a macro only with the image- or selection width

Hi Tersmuse,

Are you trying to achieve something like a 50% reduction in image size with different ratio images? If so this can be done by selecting the layer, if it is locked then unlock, go to the Transform Panel, overtype the entire W box, enter W/2 or whatever formula will achieve the desired results, make sure that the lock between W&H is active, this will ignore the pixel dimensions and resize proportionally, then clip canvas if reducing the image. You can also enlarge by using W*2 or whatever size you need, now select document unclip canvas. This method also retains the original dpi. It might not seem so because if you now select the layer the dpi will show the effect of the resize, but if you look in the resize document box the original dpi is there. I have tested this by exporting the reduced mage to jpg, when this is opened the original dpi is still present. You might like to add some sharpening to your macro to compensate for the resizing.

 

Screen Shot 2019-07-13 at 10.30.44.png

Screen Shot 2019-07-13 at 10.36.30.png

Screen Shot 2019-07-13 at 10.30.06.png

Share this post


Link to post
Share on other sites

An example: Image width:

I have photos with different ratios: 4:3 and 3:2. I need the photos to have a width of 1000 px.

The 4:3 photo has a size of 4000 x 3000 px, proportionally resulting a height of 750 px by a width of 1000 px = 1000 x 750 px.
The 3:2 photo has a size of 4000 x 2667 px, proportionally resulting a height of 667 px by a width of 1000 px = 1000 x 667 px.

What's the problem now?
I want a macro in which I only have the picture width, e.g. 1000 px. The height should stay proportionally. Recording the image width will record the height also. I don't want that, I want it to remain proportinal.

width.png

Share this post


Link to post
Share on other sites
22 minutes ago, tersmuse said:

I want a macro in which I only have the picture width, e.g. 1000 px. The height should stay proportionally. Recording the image width will record the height also. I don't want that, I want it to remain proportinal.

You might want to consider File > New Batch Job, which provides the ability to resize multiple files as you'd like, and also provides the facility to let you run macros on the files. Just leave the resizing out of the macro, and let the batch job handle that.

But if you want to have a macro that can resize images that have different aspect ratios, your macro will need to use Filters > Distort > Equations to accomplish it. There are examples of that in (I think) the Resources and/or Tutorials forum.

However, there are also reports of macros using these functions in 1.6 that don't work in 1.7. So you might not be able to use such a macro directly; only as a model.

For example:

  1. https://forum.affinity.serif.com/index.php?/topic/55541-macro-to-dynamically-resize-an-images-height-from-1000px-to-100px-in-100px-increments-using-the-equations-filter/&do=findComment&comment=282487
     
  2. https://forum.affinity.serif.com/index.php?/topic/52019-resize-an-image-to-a-fixed-maximum-size/&tab=comments#comment-262387

-- Walt

Windows 10 Home, version 1903 (18362.145), 16GB memory, Intel Core i7-6700K @ 4.00Gz, GeForce GTX 970
Affinity Photo 1.7.1.404 and 1.7.2.424 Beta   / Affinity Designer 1.7.1.404 and 1.7.2.424 Beta  / Affinity Publisher 1.7.1.404 and 1.7.2.422 Beta

Share this post


Link to post
Share on other sites
Posted (edited)

Try this in a macro:

Layer Unlock
Layer > Rasterize
Filter > Distort > Equations
Enter the following in the x and y fields, then Apply
x=x*w/1000
y=y*w/1000
Document > Clip Canvas
Layer > Rasterize and Trim

The last line is new with 1.7. It makes the final stages simpler.

Here is the macro itself:

Resize to 1000 wide.afmacro

This has worked for me just now.

John

Edited by John Rostron
Corrected formula for y

Windows 10, Affinity Photo 1.7 and Designer 1.7, (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post


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

y=y*y/1000

Typo? :/

 


Alfred online2long.gif
Affinity Designer/Photo/Publisher 1.7.1.404 • Windows 10 Home (4th gen Core i3 CPU)
Affinity Photo for iPad 1.7.1.143 • Designer for iPad 1.7.1.1 • iOS 12.3.1 (iPad Air 2)

Share this post


Link to post
Share on other sites
10 minutes ago, Alfred said:

Typo? :/

Yes indeed. I have corrected my posting.

John


Windows 10, Affinity Photo 1.7 and Designer 1.7, (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post


Link to post
Share on other sites

such a simple thing so complicated ...
and it doesn't work either. I need to create a separate macro with 7 steps for each ratio (!?). I'm quicker if I do it manually via "Resize document". Why surely such a simple thing (image width (not height)) can' be written in a macro? I miss Photoshop ;)

Thanks for trying to help.

Share this post


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

I need to create a separate macro with 7 steps for each ratio (!?).

The macro I supplied will scale the height in proportion to the width (note the similar scaling factor w/1000 for each axis), so it should work for all aspect ratios. Are you looking for macros for different final widths?  If you need them for batch processing, then you will indeed need to have a separate macro for each target width. Just substitute the target width for each of the 1000 values in the macro.

However, if you are looking for a single macro that will give you different target widths, then yes it can be done. However, you will not be able to use it in batch processing, since you would need to set the parameter for each image target width.

If you would like a macro to resize to a width specified when you use the macro, then I can do that for you. I can also provide you with a set of macros that resize images to different target widths, for example 640, 800, 1000, 1200, 1600 etc. What would you like?


Windows 10, Affinity Photo 1.7 and Designer 1.7, (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post


Link to post
Share on other sites

Resize to variable width.afmacro

Here is a macro to set an image to a width chosen at run-time. There is a parameter a, which defaults to 0.5. Varying this will vary the final width. If a=1, then the width will be 4000px. Setting it to 0.25 gives a 1000px width.

It is more convenient to enter the parameter as a fraction, so that if you want a final width of 1028px, then for the run-time parameter, enter 1028/4000 in the box at the right:

Runtime.png.8da17d9d51fab559d7eb5d6901939c64.png

If you want to see the macro itself, here are the steps:

Layer > Unlock
Layer > Rasterize
Filter > Distort > Equations
    Enter the following in the x and y fields, then Apply
x=x*w/(4000*a)
y=y*w/(4000*a)

Document > Clip Canvas
Layer > Rasterize and Trim

Note that you don't need to enter this yourself. Just download the macro and import it.

JOhn
 


Windows 10, Affinity Photo 1.7 and Designer 1.7, (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post


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

If you need them for batch processing, then you will indeed need to have a separate macro for each target width.

For batch processing, wouldn't it be simpler to just specify the desired width in the batch job dialog? A macro should not be needed at all for a simple resize operation, as the batch job facility supports that already.

ps: Thanks for your macro work that you've been sharing with us.


-- Walt

Windows 10 Home, version 1903 (18362.145), 16GB memory, Intel Core i7-6700K @ 4.00Gz, GeForce GTX 970
Affinity Photo 1.7.1.404 and 1.7.2.424 Beta   / Affinity Designer 1.7.1.404 and 1.7.2.424 Beta  / Affinity Publisher 1.7.1.404 and 1.7.2.422 Beta

Share this post


Link to post
Share on other sites

ImageMagick ...

Quote

convert bild.jpg -resize 1000 ausgabe.jpg

... resizes to a given pixel width and keeps/handles the height proportional to the given image aspect ratio. - A pretty simple no brainer, when placed in a shell script or Powershell script etc. with passed over width setting and file arguments expansion, you have a generic reusable script for those things.


☛ Affinity Designer 1.7.1 ◆ Affinity Photo 1.7.1 ◆ OSX El Capitan

Share this post


Link to post
Share on other sites

@walt.farrell, @v_kyr, you are right about this. I was trying to respond to th OP and got sidetracked into batch processing.

John


Windows 10, Affinity Photo 1.7 and Designer 1.7, (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post


Link to post
Share on other sites

I can't use any of this. I can't apparently convey what I need. And it's so incredibly simple. And you make it so complicated ;) with batch process ... I don't need that, just a simple change of the width for one photo.

 

photoshop-actions.png

Share this post


Link to post
Share on other sites
6 minutes ago, tersmuse said:

I can't use any of this. I can't apparently convey what I need. And it's so incredibly simple. And you make it so complicated ;) with batch process ... I don't need that, just a simple change of the width for one photo.

If you just want to change the width for one photo at a time, why do you need a macro? You can simply load the photo, go to the Transform panel, link the W and H controls to lock the aspect ratio, and then type in whatever value you want for the width.


Alfred online2long.gif
Affinity Designer/Photo/Publisher 1.7.1.404 • Windows 10 Home (4th gen Core i3 CPU)
Affinity Photo for iPad 1.7.1.143 • Designer for iPad 1.7.1.1 • iOS 12.3.1 (iPad Air 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

×