I want to apply all LUTs one after another to the image

I use the Scanning Electron Microscope to image in Black and white . Applying LUTs separates the image based on density. I want to select the LUT which differentiates best. I would like to apply all the LUTs one after another to the image and print the output as a pdf (with the name of the applied LUT under the Image.) can anyone please make a macro for me. Thanks

The goal of this forum is to foster independent learning. I suggest you put at least as much effort in research for your question as you expect others to put into the solution for you. (Nobody is paid for offering help here on the forum.)

I suggest you start with running the macro recorder while performing steps like duplicating the image and switching the LUT. This will generate the commands you need to solve the task. You’ll likely need a for loop then to iterate over the LUT entries.

This page will get you started:

Don’t hesitate to ask more specifically if you need more help.

Sir,thanks
I tried like this

setBatchMode(true);
run("16_colors");
saveAs("Tiff", "C://Users//Admin//Desktop//112233//16_colors_381.tiff");

setBatchMode(true);
run("Fire");
saveAs("Tiff", "C://Users//Admin//Desktop//112233//2fullfire_381.tiff");

While the first part gives the result , the second is unable to color, Should I duplicate the image, or how can I read the original image again, It will be nice if I can convert the image to 8 bit by a program call thanks

Solved
By the generous help of Dr.Alex Herbert at MRC Genome Damage and Stability Centre
University of Sussex , Falmer, BN1 9RQ , this was solved, thank you so much .
The directory will contain all images, you can use Photogallery addin ver 4.6 developed by Graham Mayor Photo Gallery Add-in Template to insert all the LUT processed images into a Microsoft Word Document


// Colour the current image with different LUTs and save as a JPEG

title = getTitle();
dir = getDirectory("Choose output directory");

luts = newArray("Red","Green","Blue","Fire","16_colors","5_ramps","5percent","6_Reserved_Colors","6_shades","8color","10_Percent","16_color","16_colors","16-color","20_Colors","32_Colors","A_Squared","Amber","angle","Auxctq",   "biop-12colors","biop-Amber","biop-Azure","biop-BrightPink","biop-Chartreuse","biop-ElectricIndigo","biop-SpringGreen","BlackOnWhite","blue","Blue_Green","Blue_Green_Red","blue_orange","blue_orange_icb","Blue_Red_Yellow","bluegreenred","Blue-Orange","Brain","brgbcmyw","Brown_Body","Bullseye","cameca_temperature","CEqual","Ceretec","CETcyclic_grey_15-85_c0_n256","CETcyclic_grey_15-85_c0_n256_s25","CETcyclic_mrybm_35-75_c68_n256","CETcyclic_mrybm_35-75_c68_n256_s25","CETcyclic_mygbm_30-95_c78_n256","CETcyclic_mygbm_30-95_c78_n256_s25","CETcyclic_wrwbw_40-90_c42_n256","CETcyclic_wrwbw_40-90_c42_n256_s25","CETcyclic-protanopic-deuteranopic_bwyk_16-96_c31_n256","CETcyclic-protanopic-deuteranopic_wywb_55-96_c33_n256","CETcyclic-tritanopic_cwrk_40-100_c20_n256","CETcyclic-tritanopic_wrwc_70-100_c20_n256","CETdiverging_bkr_55-10_c35_n256","CETdiverging_bky_60-10_c30_n256","CETdiverging_bwr_40-95_c42_n256","CETdiverging_bwr_55-98_c37_n256","CETdiverging_cwm_80-100_c22_n256","CETdiverging_gwr_55-95_c38_n256","CETdiverging_gwv_55-95_c39_n256","CETdiverging-isoluminant_cjm_75_c23_n256","CETdiverging-isoluminant_cjo_70_c25_n256","CETdiverging-linear_bjr_30-55_c53_n256","CETdiverging-linear_bjy_30-90_c45_n256","CETdiverging-protanopic-deuteranopic_bwy_60-95_c32_n256","CETdiverging-rainbow_bgymr_45-85_c67_n256","CETdiverging-tritanopic_cwr_75-98_c20_n256","CETisoluminant_cgo_70_c39_n256","CETisoluminant_cgo_80_c38_n256","CETisoluminant_cm_70_c39_n256","CETlinear_bgyw_15-100_c67_n256","CETlinear_blue_5-95_c73_n256","CETlinear_blue_95-50_c20_n256","CETlinear_bmw_5-95_c86_n256","CETlinear_bmy_10-95_c71_n256","CETlinear_gow_60-85_c27_n256","CETlinear_gow_65-90_c35_n256","CETlinear_green_5-95_c69_n256","CETlinear_grey_0-100_c0_n256","CETlinear_grey_10-95_c0_n256","CETlinear_kryw_0-97_c73_n256","CETlinear_kryw_0-100_c71_n256","CETlinear_ternary-blue_0-44_c57_n256","CETlinear_ternary-green_0-46_c42_n256","CETlinear_ternary-red_0-50_c52_n256","CETlinear-protanopic-deuteranopic_kbjyw_5-95_c25_n256","CETlinear-protanopic-deuteranopic_kbw_5-98_c40_n256","CETlinear-tritanopic_krjcw_5-95_c24_n256","CETlinear-tritanopic_krjcw_5-98_c46_n256","CETrainbow_bgyr_35-85_c72_n256","CETrainbow_bgyrm_35-85_c69_n256","Cividis","colder","cool","CTI_RAS","Cyan Hot","Cyclic","edges","Fire-1","Fire-2","GE","ge-16","ge-256","gem","GEM-16","GEM-256","glasbey","glasbey_inverted","glasbey_on_dark","glow","Gold","gray","Grayscale","Green Fire Blue","Green","Green_Table","greenyellowred","Grey","Heart","HiLo","hot","Hot_Iron","hotter","HSI_hue","ICA","ICA2","ICA3","Ice","Invert_Grayscale","Invert_Grey","Isocontour","Jet","lifetime","linear","log","log_blue","Log_Down","log_gray","log_green","log_red","Log_Up","Magenta Hot","Magenta","MMC","mpl-inferno","mpl-magma","mpl-plasma","mpl-viridis","multi","NanoJ-Orange","NICE","NICE_whiteback","Orange Hot","phase","physics","PIXEF","PIXRED","prism","Rainbow RGB","Rainbow","rand","Red Hot","Red","royal","S_Pet","sepia","smart (2)","smart","Sopha","Spectrum","Split_BlackBlue_RedWhite","Split_BlackWhite_GE","Split_BlackWhite_WarmMetal","Split_BlueRed_WarmMetal","sqrt", "SQUIRREL-Errors","SQUIRREL-FRC","StarsAndStripes","step4","step5","step10","step20","thal","Thal_16","Thal_256","Thal_Map","thallium","Thermal (2)","Thermal","Thermal-SP","ThunderSTORM","unionjack","warm","Warm_Metal","White_Blue_Green_Red","Yellow Hot","Yellow_WFG","Edges (2)","Royal (2)","Thermal (2)","cool (2)","smart (2)");

for (i=0; i < luts.length; i++) {
  lut = luts[i];
  run(lut);
  saveAs("Jpeg", dir+title+"_"+lut+".jpg");
}

Hi @VIROCON_2016,

Upgrade to the latest ImageJ daily build and you will no longer need a macro to preview all available LUTs. Simple press “l” (Plugins>Utilities>Find Commands), click on “Apply LUTs”, select one of the LUTs, then use the up and down arrow keys to step through the LUTs. This awesome new feature was contributed by Jerome Mutterer.

2 Likes