Sorry, can't edit my post for some reason, the second code example should read:
convert "livingroom0-2560x1280.jpg" -crop 512x512 -set filename:yLoc "%[fx:page.y/512]" \
-set filename:xLoc "%[fx:page.x/512]" +repage "tile_%02[filename:xLoc]_%02[filename:yLoc].png"
and when I run that, I get ...
Search found 2 matches
- 2016-12-21T04:15:56-07:00
- Forum: Users
- Topic: 0-padding numbers in filename when using fx calculation
- Replies: 2
- Views: 8510
- 2016-12-21T04:10:00-07:00
- Forum: Users
- Topic: 0-padding numbers in filename when using fx calculation
- Replies: 2
- Views: 8510
0-padding numbers in filename when using fx calculation
I'm splitting a large image into tiles, with the X, Y coord of each tile in the tile filenames:
convert "livingroom0-2560x1280.jpg" -crop 512x512 -set filename:tile "%[fx:page.x/512]_%[fx:page.y/512]" \
+repage "tile_%[filename:tile].png"
This works fine but I'd like to 0-pad the filenames so ...
convert "livingroom0-2560x1280.jpg" -crop 512x512 -set filename:tile "%[fx:page.x/512]_%[fx:page.y/512]" \
+repage "tile_%[filename:tile].png"
This works fine but I'd like to 0-pad the filenames so ...