GMIC film simulation command line

Howdy folks, I’m back to messing with Termux on Android for film emulation, and trying to simplify the process now that gmic is compiled for Termux. I am thinking it will be a better, fast, more flexible solution that using image/graphicsmagick was. I have a couple questions I’m hoping some of you can answer (especially @David_Tschumperle?) about how to write a one-liner to do this with gmic.
First, does gmic only do film emulation with the “gmic_film_cluts.gmz” file, or can we simply point it to any haldCLUT? Which would be the preferred route considering that we are doing this on a phone with limited storage, memory, and processing power?
Second, considering whatever the answer to the first question is, what’s the most efficient line of code to accomplish the task with gmic? I’m totally new to the gmic command line, so any help at all here will be greatly appreciated!

The main command you need is “map_clut”. Here’s what I think happens (not totally sure since I don’t use this):

gmic clut fuji_160c

That makes gmic download the gmic_film_cluts.gmz file, then extract and convert this into a compressed “real” clut. On linux it appears in “~\.config\gmic\clut_fuji_160c.cimgz”. Cimgz is a format gmic can use (not a standard zip). You can either do this:

gmic image.png clut fuji_160c map_clut.. .

or point it directly to the file with this:

gmic image.png clut_fuji_160c.cimgz map_clut.. .

Some notes: I think map_clut expects a 3D clut, so if you wish to use a haldCLUT 2D image you probably have to resize it first to a cube w=h=d. If you get stuck I can investigate further…

David will be busy for a while so may not reply quickly!

Awesome, thanks @garagecoder! I will start experimenting with this using your code as a starting point. Hopefully I’ll make some progress integrating this with the Termux file picker to make it easier. I’ll report back!

If it is any of the builtin cluts then all you need to do is

gmic sample tiger map_clut summer output tiger.png

As for converting cluts, I think it was addressed in a few places in discuss but I can’t find it at the moment. Search came up with How to uncompress gmic_film_cluts.gmz ?.

PS

Toggle for list of builtin cluts.

{ 60's | 60's_faded | 60's_faded_alt | agfa_apx_100 | agfa_apx_25 | agfa_precisa_100 | agfa_ultra_color_100 | agfa_vista_200 | alien_green | analogfx_anno_1870_color | analogfx_old_style_i | analogfx_old_style_ii | analogfx_old_style_iii | analogfx_sepia_color | analogfx_soft_sepia_i | analogfx_soft_sepia_ii | black_and_white | bleach_bypass | blue_mono | color_rich | expired_fade | expired_polaroid | extreme | fade | faded | faded_alt | faded_analog | faded_extreme | faded_vivid | faux_infrared | fuji3510_constlclip | fuji3510_constlmap | fuji3510_cuspclip | fuji3513_constlclip | fuji3513_constlmap | fuji3513_cuspclip | fuji_160c | fuji_160c_+ | fuji_160c_++ | fuji_160c_- | fuji_400h | fuji_400h_+ | fuji_400h_++ | fuji_400h_- | fuji_800z | fuji_800z_+ | fuji_800z_++ | fuji_800z_- | fuji_astia_100f | fuji_fp-100c | fuji_fp-100c_+ | fuji_fp-100c_++ | fuji_fp-100c_+++ | fuji_fp-100c_++_alt | fuji_fp-100c_- | fuji_fp-100c_-- | fuji_fp-100c_cool | fuji_fp-100c_cool_+ | fuji_fp-100c_cool_++ | fuji_fp-100c_cool_- | fuji_fp-100c_cool_-- | fuji_fp-100c_negative | fuji_fp-100c_negative_+ | fuji_fp-100c_negative_++ | fuji_fp-100c_negative_+++ | fuji_fp-100c_negative_++_alt | fuji_fp-100c_negative_- | fuji_fp-100c_negative_-- | fuji_fp-3000b | fuji_fp-3000b_+ | fuji_fp-3000b_++ | fuji_fp-3000b_+++ | fuji_fp-3000b_- | fuji_fp-3000b_-- | fuji_fp-3000b_hc | fuji_fp-3000b_negative | fuji_fp-3000b_negative_+ | fuji_fp-3000b_negative_++ | fuji_fp-3000b_negative_+++ | fuji_fp-3000b_negative_- | fuji_fp-3000b_negative_-- | fuji_fp-3000b_negative_early | fuji_fp_100c | fuji_ilford_delta_3200 | fuji_ilford_delta_3200_+ | fuji_ilford_delta_3200_++ | fuji_ilford_delta_3200_- | fuji_ilford_hp5 | fuji_ilford_hp5_+ | fuji_ilford_hp5_++ | fuji_ilford_hp5_- | fuji_neopan_1600 | fuji_neopan_1600_+ | fuji_neopan_1600_++ | fuji_neopan_1600_- | fuji_neopan_acros_100 | fuji_provia_100f | fuji_provia_400f | fuji_provia_400x | fuji_sensia_100 | fuji_superia_100 | fuji_superia_100_+ | fuji_superia_100_++ | fuji_superia_100_- | fuji_superia_1600 | fuji_superia_1600_+ | fuji_superia_1600_++ | fuji_superia_1600_- | fuji_superia_200 | fuji_superia_200_xpro | fuji_superia_400 | fuji_superia_400_+ | fuji_superia_400_++ | fuji_superia_400_- | fuji_superia_800 | fuji_superia_800_+ | fuji_superia_800_++ | fuji_superia_800_- | fuji_superia_hg_1600 | fuji_superia_reala_100 | fuji_superia_x-tra_800 | fuji_velvia_50 | fuji_xtrans_ii_astia_v2 | fuji_xtrans_ii_classic_chrome_v1 | fuji_xtrans_ii_pro_neg_hi_v2 | fuji_xtrans_ii_pro_neg_std_v2 | fuji_xtrans_ii_provia_v2 | fuji_xtrans_ii_velvia_v2 | generic_fuji_astia_100 | generic_fuji_provia_100 | generic_fuji_velvia_100 | generic_kodachrome_64 | generic_kodak_ektachrome_100_vs | golden | golden_bright | golden_fade | golden_mono | golden_vibrant | goldfx_bright_spring_breeze | goldfx_bright_summer_heat | goldfx_hot_summer_heat | goldfx_perfect_sunset_01min | goldfx_perfect_sunset_05min | goldfx_perfect_sunset_10min | goldfx_spring_breeze | goldfx_summer_heat | green_mono | hong_kong | ilford_delta_100 | ilford_delta_3200 | ilford_delta_400 | ilford_fp4_plus_125 | ilford_hp5_plus_400 | ilford_hps_800 | ilford_pan_f_plus_50 | ilford_xp2 | kodak2383_constlclip | kodak2383_constlmap | kodak2383_cuspclip | kodak2393_constlclip | kodak2393_constlmap | kodak2393_cuspclip | kodak_bw_400_cn | kodak_e-100_gx_ektachrome_100 | kodak_ektachrome_100_vs | kodak_elite_100_xpro | kodak_elite_chrome_200 | kodak_elite_chrome_400 | kodak_elite_color_200 | kodak_elite_color_400 | kodak_elite_extracolor_100 | kodak_hie_(hs_infra) | kodak_kodachrome_200 | kodak_kodachrome_25 | kodak_kodachrome_64 | kodak_portra_160 | kodak_portra_160_+ | kodak_portra_160_++ | kodak_portra_160_- | kodak_portra_160_nc | kodak_portra_160_nc_+ | kodak_portra_160_nc_++ | kodak_portra_160_nc_- | kodak_portra_160_vc | kodak_portra_160_vc_+ | kodak_portra_160_vc_++ | kodak_portra_160_vc_- | kodak_portra_400 | kodak_portra_400_+ | kodak_portra_400_++ | kodak_portra_400_- | kodak_portra_400_nc | kodak_portra_400_nc_+ | kodak_portra_400_nc_++ | kodak_portra_400_nc_- | kodak_portra_400_uc | kodak_portra_400_uc_+ | kodak_portra_400_uc_++ | kodak_portra_400_uc_- | kodak_portra_400_vc | kodak_portra_400_vc_+ | kodak_portra_400_vc_++ | kodak_portra_400_vc_- | kodak_portra_800 | kodak_portra_800_+ | kodak_portra_800_++ | kodak_portra_800_- | kodak_t-max_100 | kodak_t-max_3200 | kodak_t-max_400 | kodak_tmax_3200 | kodak_tmax_3200_+ | kodak_tmax_3200_++ | kodak_tmax_3200_- | kodak_tri-x_400 | kodak_tri-x_400_+ | kodak_tri-x_400_++ | kodak_tri-x_400_- | light_blown | lomo | lomography_redscale_100 | lomography_x-pro_slide_200 | mono_tinted | mute_shift | muted_fade | natural_vivid | nostalgic | orange_tone | pink_fade | polaroid_664 | polaroid_665 | polaroid_665_+ | polaroid_665_++ | polaroid_665_- | polaroid_665_-- | polaroid_665_negative | polaroid_665_negative_+ | polaroid_665_negative_- | polaroid_665_negative_hc | polaroid_667 | polaroid_669 | polaroid_669_+ | polaroid_669_++ | polaroid_669_+++ | polaroid_669_- | polaroid_669_-- | polaroid_669_cold | polaroid_669_cold_+ | polaroid_669_cold_- | polaroid_669_cold_-- | polaroid_672 | polaroid_690 | polaroid_690_+ | polaroid_690_++ | polaroid_690_- | polaroid_690_-- | polaroid_690_cold | polaroid_690_cold_+ | polaroid_690_cold_++ | polaroid_690_cold_- | polaroid_690_cold_-- | polaroid_690_warm | polaroid_690_warm_+ | polaroid_690_warm_++ | polaroid_690_warm_- | polaroid_690_warm_-- | polaroid_polachrome | polaroid_px-100uv+_cold | polaroid_px-100uv+_cold_+ | polaroid_px-100uv+_cold_++ | polaroid_px-100uv+_cold_+++ | polaroid_px-100uv+_cold_- | polaroid_px-100uv+_cold_-- | polaroid_px-100uv+_warm | polaroid_px-100uv+_warm_+ | polaroid_px-100uv+_warm_++ | polaroid_px-100uv+_warm_+++ | polaroid_px-100uv+_warm_- | polaroid_px-100uv+_warm_-- | polaroid_px-680 | polaroid_px-680_+ | polaroid_px-680_++ | polaroid_px-680_- | polaroid_px-680_-- | polaroid_px-680_cold | polaroid_px-680_cold_+ | polaroid_px-680_cold_++ | polaroid_px-680_cold_++_alt | polaroid_px-680_cold_- | polaroid_px-680_cold_-- | polaroid_px-680_warm | polaroid_px-680_warm_+ | polaroid_px-680_warm_++ | polaroid_px-680_warm_- | polaroid_px-680_warm_-- | polaroid_px-70 | polaroid_px-70_+ | polaroid_px-70_++ | polaroid_px-70_+++ | polaroid_px-70_- | polaroid_px-70_-- | polaroid_px-70_cold | polaroid_px-70_cold_+ | polaroid_px-70_cold_++ | polaroid_px-70_cold_- | polaroid_px-70_cold_-- | polaroid_px-70_warm | polaroid_px-70_warm_+ | polaroid_px-70_warm_++ | polaroid_px-70_warm_- | polaroid_px-70_warm_-- | polaroid_time_zero_(expired) | polaroid_time_zero_(expired)_+ | polaroid_time_zero_(expired)_++ | polaroid_time_zero_(expired)_- | polaroid_time_zero_(expired)_-- | polaroid_time_zero_(expired)_--- | polaroid_time_zero_(expired)_cold | polaroid_time_zero_(expired)_cold_- | polaroid_time_zero_(expired)_cold_-- | polaroid_time_zero_(expired)_cold_--- | purple | retro | rollei_ir_400 | rollei_ortho_25 | rollei_retro_100_tonal | rollei_retro_80s | rotate_muted | rotate_vibrant | rotated | rotated_crush | smooth_cromeish | smooth_fade | soft_fade | solarized_color | solarized_color2 | summer | summer_alt | sunny | sunny_alt | sunny_rich | sunny_warm | super_warm | super_warm_rich | sutro_fx | technicalfx_backlight_filter | vibrant | vibrant_alien | vibrant_contrast | vibrant_cromeish | vintage | vintage_alt | vintage_brighter | warm | warm_highlight | warm_yellow | zilverfx_b_w_solarization | zilverfx_infrared | zilverfx_vintage_b_w }

1 Like

Thanks @afre! Very very helpful…