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

Is this action (+white blank) the possible with a macro?


Recommended Posts

I need macro.
Is this action the possible with a macro?

I want to process 1000 images (in a folder) with one button.
1, It adds a margins (white blank?) up to multiples of 100 to the long size of the rectangular image.
2. It adds a margin (white blank?) to the short size so that the long size is the same. It will be square.
3. Save with jpg image quality 85.

sample 1
size 2222x3333
1, 2222x3400(+67)
2, 3400(+1178)x3400
3, save

sample 2
size 4444x2222
1, 4500x2222
2, 4500x4500
3, save

If possible, I would like to buy it. Photoshop is expensive.
 

Link to comment
Share on other sites

Macros cannot process multiple files. Nor can they perform a Save operation.

However, File > New Batch Job can process multiple files. And it can run one or more macros.

The tricky part will be in creating a macro that can operate on images of different sizes or orientations. That can be done, but I will let others who are more qualified comment further on that.

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

1 hour ago, walt.farrell said:

The tricky part will be in creating a macro that can operate on images of different sizes or orientations.

Don't forget the first part here, namely to round up the longer determined side to the next hundreds ...

Quote

> python
>>> def roundup(x):
...     x -= x % -100
...     return x
...
>>> roundup(3333)
3400
>>> roundup(4444)
4500
>>>

... which is a nobrainer to do via Python scripting, as is overall the white space padding to a square for the images too there.

☛ 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

3 hours ago, nobu1 said:

>Macros cannot process multiple files.

I need a software for macro for this function.
I must process 1000 files. 1 file only!?
I am confused for buying.

Macro's in Affinity are in their infancy and should be considered rudimentary macro's for the time being. You could potentially create a macro to process a single file and add that macro to a batch job as @walt.farrell has mentioned but I'm not sure how effective it would be over 1000s of images.

Really, you need a more specific app that is designed for batch processing, one of the best I've seen in a while is Retro Batch Pro, it's node based and so easy a 5 year old kid could use it, I think it will do exactly what you want with ease. I would recommend downloading the Trial and testing it out on a sample batch. 

I would still consider buying Affinity so you can edit images if you need to, still worth having and hopefully the macro capabilities will improve significantly in the future. 

I have no affiliation with Flying Meat the people who make Retro Batch, I just think it's a very good app.

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

6 hours ago, nobu1 said:

I need a software for macro for this function.
I must process 1000 files. 1 file only!?

Usually you don't need a graphics app with good macro capabilities (like PS) at all to do what you want. - You can do that in any better scripting or programming language easily. I show you here a quick turn around with a custom made Python script therefor.

I've used just 4 JPG images for demonstration purposes (since I'm lazy, and since it doesn't play any role if you let it process 4, 100 or 1000 files ... here) in an "test_it" subdirectory therefor. Two landscape (long side horizontal) and two portrait (long side vertical) oriented images. Then I let a Python script do all the work by pointing that to the subdirectory. The script looks into that directory, fetches and processes all the JPG-images therein, it adds the wanted rounding up for the individual image w/h and makes a padded square out of those (I used blue for the padding color, so it's better viewable here for demonstrations).

Used file sizes before padding:

img-horiz-1920.jpg  = w x h = 1920 x 1080 px
img-horiz-3444.jpg  = w x h = 3444 x 1791 px
img-vert-2048.jpg   = w x h = 1633 x 2048 px
img-vert-3333.jpg   = w x h = 2561 x 3333 px

File sizes after padding:

img-horiz-1920.jpg  = w x h = 2000 x 2000 px
img-horiz-3444.jpg  = w x h = 3500 x 3500 px
img-vert-2048.jpg   = w x h = 2100 x 2100 px
img-vert-3333.jpg   = w x h = 3400 x 3400 px

Here's a screencast of how the Python script operates then ...


As initially said, the whole is easy to do with the right tools therefor!

 

 

☛ 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

Can you share your python script @v_kyr ?

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Link to comment
Share on other sites

9 hours ago, laurent32 said:

Can you share your python script @v_kyr ?

Then the OP probably won't buy APh at all here. - Further it's an from Affinity software completely independent solution and not related in any way here to it.

Thus I think I better don't share it here officially for everyone and instead will give it only to individuals on demand via PM. I also usually don't have the time to support that further, or tell people how to install/run/adjust & use it in/with Python etc. - So look after your PM's.

☛ 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

2 hours ago, John Rostron said:

Have a look here

Well the OP wants to process 1000 images (in a folder) ideally automatically with a one button click. - The images have to be padded in such a way, that they have to be rounded up to the next hundreds on the longer side (w/h) via padding and the shorter side has to be equalled in size via padding here. So the whole image is afterwards padded accordingly to form a square padded image at the end. - And this up to 1000 times!

☛ 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

I think it is good only the square feature without the margin feature.
I will try your support. Thank you!

I can't use python due to lack of skill.
So I need software. I need to buy software.
I will continue to search it. (I don't understand python)

I want macro, so I think about purchasing one.
This is attractive only for Photoshop function.
And this support shows fast and kind.

Link to comment
Share on other sites

5 hours ago, nobu1 said:

I can't use python due to lack of skill.
So I need software. I need to buy software.
I will continue to search it. (I don't understand python)

Well using for example the more capable PS scripting here (...instead of  it's simpler PS actions - .atn files, and so it's just macro based facilities) would also need you to have some more skills/knowledge about Javascript here, since it's based entirely on that.

However, whenever you want to do very specific and more advanced custom things here, most standard ready to used tools (...especially most third party GUI tools etc.) won't offer you that overall general flexibility you are after here with your custom purposes (...individual requirements)! - Thus you should really tend to learn, educate yourself and use some much more powerful scripting language (... be it Javascript, Python, Lua, ... or whatever) here, which offers you then nearly to do everything which comes to your mind! - Since you won't find that easily any third party GUI tool, which realy offers to do all that kind of custom/specific things here (... GUI based clicky micky apps have all their limitations, which BTW is also the reason why PS and Co. offer beside much more powerful scripting capabilities here)!

Beside the above said, I could also do a GUI app for those requirements you have, BUT I would also charge then money for that, since it's much more expenditure of time to do so, instead of writing quickly a few lines of Python code here! 😄

☛ 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

It needs some quite complicated arithmetic which cannot be accomplished with macros in Affinity Photo.

Any sort of scripting solution would require you to learn a scripting language. It's also platform-dependent. If you use macOS, then you could AppleScript Image Events or use SIPS through Terminal. Both would work fast, on multiple images, without having to open the images in the user interface. 

You would need to answer additional questions: for example, do you want to create new, padded versions of the original images or do you want to overwrite the originals? What happens in the extreme (and admittedly unlikely) case of an already square image whose existing dimensions are already a multiple of 100? Do you want the script to work on .jpgs, or .pngs, or .tifs, or a mixture? What if the longest dimension of the original image is an odd number of pixels?

It's possible, but there is no straightforward solution.

Affinity Photo 2.0.3,  Affinity Designer 2.0.3, Affinity Publisher 2.0.3, Mac OSX 13, 2018 MacBook Pro 15" Intel.

Link to comment
Share on other sites

1 hour ago, h_d said:

What happens in the extreme (and admittedly unlikely) case of an already square image whose existing dimensions are already a multiple of 100?

Even a good question, I can answer that at least for my Python script solution here. - Nothing will happen, since the image already does meat the final requirements then. - Also when I reprocess all the images, I've once before already processed to be altered accordingly, they won't change anymore here as they do already meet the final requirements.

1 hour ago, h_d said:

What if the longest dimension of the original image is an odd number of pixels?

That doesn't matter here, due to the always rounding up to the next hundreds, see also my above last image example in the shown test run ...

--> img-vert-3333.jpg  = w x h = 2561 x 3333 px  ... will get ... = 3400 x 3400 px

... therefore you always end up with an even number of pixels!

...
def roundup(x):
	x -= x % -100
	return x

def pad_image_to_quare_size(image):
    ...
    width, height = image.size
    ...
    width_max = roundup(width)
    height_max = roundup(height)
    ...
    ...
    img_padded = Image.new(image.mode, (width_max, height_max), (0, 0, 255))
    img_padded.paste(image, (pad_left, pad_top))
    return img_padded
...

 

☛ 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

16 minutes ago, v_kyr said:

therefore you always end up with an even number of pixels!

But you have to halve the difference between the original and the padded version.

3400-3333 = 67

Equal padding on either side is 67/2 : 33.5 pixels.

How do you add 33.5 pixels (including half a pixel) to each side of the padded image?

 

 

 

Affinity Photo 2.0.3,  Affinity Designer 2.0.3, Affinity Publisher 2.0.3, Mac OSX 13, 2018 MacBook Pro 15" Intel.

Link to comment
Share on other sites

4 minutes ago, h_d said:

But you have to halve the difference between the original and the padded version.

3400-3333 = 67

Equal padding on either side is 67/2 : 33.5 pixels.

How do you add half a pixel to each side of the padded image?

...
diff_vert = height_max - h
pad_top = diff_vert//2
pad_bottom = diff_vert - pad_top
diff_hori = width_max - w
pad_left = diff_hori//2
pad_right = diff_hori - pad_left
img_padded = Image.new(image.mode, (width_max, height_max), (0, 0, 255)) ### <--- check this ...
img_padded.paste(image, (pad_left, pad_top))  ### <--- and this line
...

Easy, look at the last two lines above. You create a new image of width_max & height_max which are the already rounded sizes, in some given padding color. Afterwards you place/paste the orig image on the determined left & top padding coordinate orientation of that new image!

☛ 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

Landscape, portrait image orientation isn't really needed to keep track of here, since at the end you either way should have just a square. - Thus you just need to equalize the shorter side value to the longer side value ...

...
width_max = roundup(width)
height_max = roundup(height)
if width_max > height_max:
   height_max = width_max
else:
   width_max = height_max
...

Further you can probably even in AppleScript round up immediately to hundreds easier via something like this ...

set imageWidth  to (imageWidth - imageWidth mod -100)
set imageHeight to (imageHeight - imageHeight mod -100)

☛ 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

11 hours ago, nobu1 said:

I understood it now.
I want to add margins on the right and bottom.
So odd numbers are no ploblem.

It want to leave the original image and make a new image.

You should more clearly redefine and formulate your requirements here, best also give some before and after image examples which also visually show what you want at the end to come out! - Also tell the OS you would have to use that for!

And if you are not that much skilled about scripting languages, you can instead look at ImageMagick which offers very powerful commands for nearly all kind of image editing and image manipulations too. It can of course also pad images, add borders to images ... etc. etc. - And in case you are not the terminal/shell/cmd line guy, then you can also try out a GUI frontend for that "FotoKilof - GUI for ImageMagick". But guess what, that's also made in Python here! 😉

☛ 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

2 hours ago, v_kyr said:

Further you can probably even in AppleScript round up immediately to hundreds easier via something like this ...

set imageWidth  to (imageWidth - imageWidth mod -100)
set imageHeight to (imageHeight - imageHeight mod -100)

Sadly no.

1254492681_Screenshot2023-02-19at01_34_05.png.4436ff0264cd87848145b5a46dfa2698.png


The following AppleScript works for me (on a single image - it would need to be modified for a folder containing images).

 

set theImageFile to (choose file of type "public.image") as string

set whitePadding to {65535, 65535, 65535}

tell application "Image Events"

launch

set theImage to open theImageFile

tell theImage

set {imageWidth, imageHeight} to dimensions

if imageWidth > imageHeight then

set longSide to imageWidth

set shortSide to imageHeight

set imageOrientation to "landscape"

else

set longSide to imageHeight

set shortSide to imageWidth

set imageOrientation to "portrait"

end if

set squareFinal to round ((100 - (text -2 thru -1 of (longSide as string) as integer))) + longSide rounding up

set longDiff to squareFinal - longSide

set longPadding to round (longDiff / 2) rounding up

set firstLongPadded to (longSide + longPadding)

set secondLongPadded to (firstLongPadded + longPadding)

set shortDiff to squareFinal - shortSide

set shortPadding to round (shortDiff / 2) rounding up

set firstShortPadded to shortSide + shortPadding

set secondShortPadded to firstShortPadded + shortPadding as integer

if imageOrientation = "landscape" then

pad to dimensions {firstLongPadded, firstShortPadded} with pad color whitePadding

save

rotate to angle 180

save

pad to dimensions {secondLongPadded, secondShortPadded} with pad color whitePadding

save

rotate to angle 180

save

else

pad to dimensions {firstShortPadded, firstLongPadded} with pad color whitePadding

save

rotate to angle 180

save

pad to dimensions {secondShortPadded, secondLongPadded} with pad color whitePadding

save

rotate to angle 180

save

end if

save

end tell

close theImage

quit

end tell

 

 

It centres the image within the padding rather than placing the padding to the right and below. Which is really annoying as Image Events does that by default - I had to jump through all sorts of hoops to place half the padding on each side of the image. 

As @v_kyr says, 

1 hour ago, v_kyr said:

You should more clearly redefine and formulate your requirements

And it still adds 1 extra pixel if the longest side of the original image is an odd number of pixels long. More arithmetic needed...

Affinity Photo 2.0.3,  Affinity Designer 2.0.3, Affinity Publisher 2.0.3, Mac OSX 13, 2018 MacBook Pro 15" Intel.

Link to comment
Share on other sites

10 hours ago, h_d said:

Sadly no.

1254492681_Screenshot2023-02-19at01_34_05.png.4436ff0264cd87848145b5a46dfa2698.png

 

Looks like AppleScript doesn't take the negative sign "-100" from the number into account when performing the math modulo operation, as Python does  ...

Quote

> python3
>>> imagewidth = 1145
>>> imagewidth -= imagewidth % -100
>>> print(imagewidth)
1200


>>> imageheight = 1145
>>> imageheight = imageheight - (imageheight % -100)
>>> print(imageheight)
1200


>>> 1145 % -100
-55
>>> 1145 % 100
45

 

But it should also be doable in AppleScript instead this way then ...

applescript.jpg.07e2eb08b4f3451b53bd18e8a196cf12.jpg

applescript2.jpg.55f32c0d864436a3e833717d18ac1697.jpg

 

☛ 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

As Retrobatch was already mentioned, I can sincerely recommend it (though not free). I think it typically requires some scripting/programming skills as needs can be so varied, but it certainly provides an elegant and effective user interface for these kinds of tasks. What makes this tool specifically powerful is that in addition to JavaScript and AppleScript it also allows use of any classes from Apple's Cocoa frameworks so the possibilities are practically endless, and there is then also support for color profiles and plenty of different file formats, starting from native Acorn, JPG and PNG to such high-end formats like JPG2K, HEIC/HEIF, TIFF, PSD, and PDF. 

Here is a video clip demonstrating the app's capabilities and JavaScript that was used to create a custom plug-in to handle the task without needing to enter any code in the workflow builder (I added support to define any system color picker based matte color and alpha and shade for the extended canvas):

 

module.exports = {
       
    inputKeys: ["inputColor"],
    
    attributes: {
        "inputColor": {
            displayName: "Matte",
            default: CIColor.whiteColor(),
            type: kCIAttributeTypeColor,
        }
    },
   
    
    processAsset: function(document, rbnode, asset) {
        
        var radius = 0;
        var width = asset.imageWidth();
        var height = asset.imageHeight();
        var rndWidth = width;		
        var rndHeight = height;
        var xMargin = 0;
        var yMargin = 0
		if (width > height) {
			rndWidth = Math.ceil(width/100)*100;        
			rndHeight = rndWidth;
		}
		else {
			rndHeight = Math.ceil(height/100)*100;
			rndWidth = rndHeight;
		}
        xMargin = parseInt((rndWidth - width) / 2);
        yMargin = parseInt((rndHeight - height) / 2);

        var baseImage = asset.CIImage();
        var drawableContext = asset.emptyImageAccumulatorOfSize(CGSizeMake(rndWidth, rndHeight));
    
        drawableContext.lockFocus();
        
        var bounds = CGRectMake(0, 0, rndWidth, rndHeight);
        var path = NSBezierPath.bezierPathWithRoundedRect_xRadius_yRadius_(bounds, radius, radius);
        //NSColor.colorWithRed_green_blue_alpha(Math.random(), Math.random(), Math.random(), Math.random()).set();
        NSColor.colorWithCIColor(rbnode.nodeValues().inputColor).set();
        path.fill();
     
        drawableContext.unlockFocus();
        baseImage = baseImage.imageByApplyingTransform(CGAffineTransformMakeTranslation(xMargin, yMargin));

        var extent = baseImage.extent();
        
        drawableContext.setImage_dirtyRect(baseImage, extent);
        
        var newImage = drawableContext.image();
        
        asset.setCIImage(newImage);
                
        return true;
    },
    
};

 

Link to comment
Share on other sites

Here is Python code for doing pretty much the same (plus something extra) as above:

from PIL import Image
import math, sys
import os

def roundup(x, toVal):
    return math.ceil(x / float(toVal)) * toVal

def extend_canvas(pil_img, nearest, color, square):
    width, height = pil_img.size
    if (width > height):
        rndWidth = roundup(width, nearest)
        if (square == True):
            rndHeight = rndWidth
        else:
            rndHeight = roundup(height, nearest)
    else:
        rndHeight = roundup(height, nearest)
        if (square == True):
            rndWidth = rndHeight
        else:
            rndWidth = roundup(width, nearest)
            
    lm = int((rndWidth - width) / 2.0)
    tm = int((rndHeight - height) / 2.0)
    #print("width:", width)
    #print("height:", height)
    #print("rndWidth:", rndWidth)
    #print("rndHeight:", rndHeight)
    #print("lm:", lm)
    #print("tm:", tm)
    #result = Image.new(pil_img.mode, (rndWidth, rndHeight), color)
    #Use the one below to force JPG
	#result = Image.new('RGB', (rndWidth, rndHeight), color)
    result = Image.new('RGBA', (rndWidth, rndHeight), color)
    result.paste(pil_img, (lm, tm))
    return result

res = []
# go through the defined folder and its subfolders
for root, dirs, files in os.walk(r"C:\Users\Public\Documents\Affinity\ExtendCanvas"): 
    for file in files:
        # filter out files other than png and jpg; Python supports plenty of other; also exclude ones already extended with this routine
        if (file.endswith(".png") or file.endswith(".jpg")) and file.rfind("_extended.") == -1:
            res.append(os.path.join(root, file))

for srcFile in res:
    pos = srcFile.rfind(".")
    destFile = srcFile[:pos] + '_extended.png'
    #print("destFile:", destFile)

    im = Image.open(srcFile)
    im_new = extend_canvas(im, 100, (255, 255, 255, 255), True) #The second par defines nearest upper px value, the last of quad color values is alpha, last par True for square canvas, False for extending to nearest 100px both from the width and height
    im_new.save(destFile)

It might be worth a trouble to create a GUI for inputting options that are above given in a single row as three arguments marked in red (for the roundup pixel value), green (for the extended canvas color and alpha), and orange (for a Boolean value to tell whether the canvas should be extended into a square, or equally in both horizontal and vertical aspect): 

    im_new = extend_canvas(im, 100, (255, 255, 255, 255), True) -- would extend canvas to nearest 100 into a white square
    im_new = extend_canvas(im, 100, (255, 255, 255, 0), False) -- would extend canvas to nearest 100 from all sides as transparency

That could be done by using e.g. the free PySimpleGUI, which would keep these kinds of auxiliary features closer to concept of "graphic design", like when similar scripting based things are done from within a graphic design app itself, using an intrinsic object model whether programmed using JavaScript, Python or some other language, instead of having half-baked field input calculations and elementary macro recordings. Apps like Acorn (a single developer app) show that these kinds of advanced features do not require huge resources to become implemented as a full-fledged proprietary solution so hopefully something like this will be available soon in context of Affinity app trio, as well.

NOTE: For JPG output, you would obviously need to change the color and save parameters to something like this:

im_new = extend_canvas(im, 100, (255, 255, 255), True)

and

im_new.save(destFile, quality=85)

...and having the destFile extension as .jpg.

Link to comment
Share on other sites

Here's my above mentioned Py-script, which iterates over all image files in a given directory path and pads those images then. - Usage is:

Quote

> python3 padding.py -h || python3 padding.py --help
usage: padding.py [-h] dirpath

positional arguments:
  dirpath     the directory path to look for images

options:
  -h, --help  show this help message and exit

> python3 padding.py test_it/
Using directory path: test_it/

Processing: test_it/img-horiz-1920.jpg
Processing: test_it/img-horiz-3334.jpg
Processing: test_it/img-vert-2048.jpg
Processing: test_it/img-vert-3333.jpg
...

☛ 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

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.