: Slice an image into pieces and generate images that contain all the prior parts Say I have an image of width 1000. I need to slice the image into 100 slices ,which will generate 100 images.
Say I have an image of width 1000. I need to slice the image into 100 slices ,which will generate 100 images. Each one of the 100 images must be of length 10 * (slice number), so that it will contain all the previous parts as well.
So slice 1 will contain the first 1/100 of the initial image, slice 2 the 2/100 etc.
Is there a way to do this on Photoshop,using an online tool or any other program/library?
More posts by @Welton168
1 Comments
Sorted by latest first Latest Oldest Best
This may be a case for a batch solution.
By using the ImageMagick crop by percent function we can crop an image any given percentage from 1% to 100%.
Images below were cropped with the following command:
convert <input> -crop <x>%x0+0+0 <out>
Where <input> is the source image name, <x> is the precentage, and <out> it the output filename.
Cropped with <x> = 1, 10, 20, 30, 40, 50
Cropped with <x> = 60, 70
Cropped with <x> = 80
Cropped with <x> = 90
Cropped with <x> = 100 (this was the source image)
Of course this need not be done manually but can easily be included in a script.
On a POSIX OS the following Bash script will produce 100 stacked slices (like above) starting at 1% to 100% and write these as out-<x>.jpg in the same directory from an image given as a command line parameter.
#! /bin/bash
# filename
for ((i=100; i>=1; i--)); do
echo "$i"
convert "" -crop $i%x0+0+0 "out-$i.jpg"
done
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.