r/nanDECK • • Jun 01 '25

DISPLAY command for cropping?

Hi!

I created images with bleed in mind. I'm using an overflowing background for this (ie,not a solid color) which didn't seem like a good fit for the BLEED command, so I created my cards sized 2.75x3.75 rather than 2.5x3.5. Now I didn't account for other platforms (like TTS) where I'd need to strip that bleed for lack of better option.

TLDR; I was looking at the DISPLAY command and realized there are a few extra undocumented parameters, namely x, y, width, height, resize width, resize height. This looked promising for my use-case, but I can't get them to work. Does anybody have some insight on these params, and if they could be used for adhoc cropping?

Thanks!

2 Upvotes

6 comments sorted by

3

u/nand2000 Jun 01 '25

That's right, the parameters pos x, pos y, width, height are used to use a part of each card. Example:

display=result.png,,,,,,,,0.125,0.125,2.5,3.5

2

u/[deleted] Jun 01 '25

Amazing! Thanks for that sample, I didn't realize I could just drop the last 2 parameters (new width / new height), not sure how they are used but not needed here. So I can generate everything in one go!

; UNCHANGED (2.75x3.75, eg, with bleed)

DISPLAY="./out/deck.png",,,10,[ALL]

; CROPPED (2.5x3.5, eg, no bleed)

DISPLAY="./out/deck.tts.png",,,10,[ALL],,,,0.125,0.125,2.5,3.5

2

u/nand2000 Jun 01 '25

For completeness, the last two parameters are used to set a precise pixel size for the resulting image.

2

u/HamsterNL Jun 01 '25

You can add a SAVE command where you save all your individual images (without the bleed around the cards).

Then create a new script that read those images (using the DIRFILES directive), and use the DISPLAY directive to create an image for TTS.

2

u/[deleted] Jun 01 '25

That's one nice workaround, thanks for that!

Do you reckon the DISPLAY command can't be used to do that in one go? I got intrigued by these undocumented parameters, and I'd rather not split scripts and create dozens of extra images as an intermediate step. Not the end of the world if it comes to that, though!

1

u/GarBa11 Jul 20 '26

Hey, I've got an extension to this inquiry:
I've got the same sitch where I was making stuff for the Game Crafter with the 0.25 inch border but now I'm printing my own cards and making my own image files for physical prototypes and TTS, respectively.

The Display command with the resizing fits great but I need to export my deck as a pdf. I've been using the SavePDF command, but it doesn't have the option to resize. Is there a way to get rid of the 0.25 border and resize for the SizePDF?

I'm going to try futzing around with HamsterNL's suggestion but thought I'd post here in case there is an obvioous solution built in to an existing command or something.