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

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?

Link to comment
Share on other sites

iMac 27" 2019 Somona 14.3.1, iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

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

Link to comment
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

Link to comment
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

Link to comment
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
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

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.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

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

Link to comment
Share on other sites

1 hour ago, John Rostron said:

y=y*y/1000

Typo? :/

 

Alfred spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.4.1 (iPad 7th gen)

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

Link to comment
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.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

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

Link to comment
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.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

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

Link to comment
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
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
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.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
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 spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.4.1 (iPad 7th gen)

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.