Skip to content

Instantly share code, notes, and snippets.

@mutterer
Last active September 22, 2022 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mutterer/3056cf0365e17c86accfb8513c5405a4 to your computer and use it in GitHub Desktop.
Save mutterer/3056cf0365e17c86accfb8513c5405a4 to your computer and use it in GitHub Desktop.
image overlay transparency adjustment tool
macro "Adjust Overlay Transparency Tool - C00cT0f20A" {
getCursorLoc(x, y, z, flags);
px=x;
while (flags&16>0) {
getCursorLoc(x, y, z, flags);
if (x!=px) {
Overlay.activateSelectionAndWait(Overlay.size-1);
run("Properties... ","opacity="+100*x/getWidth+" transparent");
Overlay.removeSelection(Overlay.size-1);
Overlay.addSelection;
showStatus("Opacity: "+d2s(100*x/getWidth,0));
px=x;
}
}
}
/* below code to obtain a sample image with overlay */
/*
run("Blobs (25K)");
id=getImageID;
run("Find Maxima...", "prominence=100 exclude light output=[Segmented Particles]");
run("Analyze Particles...", "clear show=[Count Masks] exclude");
rename('mask');
run("Glasbey");
run("RGB Color");
changeValues(0xffffff, 0xffffff, 0);
selectImage(id);
run("Add Image...", "image=mask x=0 y=0 opacity=50 zero");
close("\\Others");
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment