Skip to content

Instantly share code, notes, and snippets.

@mutterer
Created September 22, 2022 20:53
Show Gist options
  • Save mutterer/0c2a8692a3bedf7775fa79e28ce93598 to your computer and use it in GitHub Desktop.
Save mutterer/0c2a8692a3bedf7775fa79e28ce93598 to your computer and use it in GitHub Desktop.
Example curtain tool macro; uses partial image overlay.
macro "Curtain Tool - C00cT0f20A" {
getCursorLoc(x, y, z, flags);
setBatchMode(true);
id=getImageID;
run("Duplicate...","title=temp");
// here goes the image transform to preview
run("Gaussian Blur...","sigma=5");
//
id2=getImageID;
px=x;
while (flags&16>0) {
selectImage(id);
getCursorLoc(x, y, z, flags);
if (x!=px) {
selectImage(id2);
makeRectangle(x,0,getWidth-x,getHeight);
run("Duplicate...","title=part");
id3=getImageID;
selectImage(id);
run("Add Image...", "image=[part] x="+x+" y=0 opacity=100 zero");
while (Overlay.size>1) Overlay.removeSelection(0);
selectImage(id3);
close();
px=x;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment